Puppeteer and Axios receive a security token that... never works

Viewed 22

I'm trying to scrape the movements of my bank account with Puppeteer, with a simple script that I run from VSCode. But the login always fails, even though the user and password are 100% correct.

After lots of HTTP requests testing, I found out the culprit is one cookie called _abck provided by the server when visiting the login url: enter image description here

If I visit the website using Chrome and copy paste that cookie, the login requests work perfectly: enter image description here

However, if I try to use the same token fresh from Puppeteer or Axios... it fails with a 403: enter image description here

I have even tried this: running the code and when Chromium appears, I open a new tab, go to my bank's website, get the cookie from devtools, paste it in a request and fails the same way. I'm puzzled.

Why? How can I get a working _abck token programmatically?

0 Answers
Related