Disane87 / docudigger

Website scraper for getting invoices automagically as pdf (useful for taxes or DMS)
https://blog.disane.dev
MIT License
56 stars 7 forks source link

OTP Required by Amazon, Scraper Fails to Retrieve Orders #1039

Open maxkpower opened 2 months ago

maxkpower commented 2 months ago

First and foremost, thank you sooo, so much for this project - i cant wait to get it up and running!

I'm using the npm package to scrape Amazon orders. Even though I don't have 2FA enabled, Amazon is requiring OTP (i'm receiving codes via SMS).

For some reason the logs show that the scraper logs in successfully, but then no orders are retrieved.

[warn] [2024-09-06 00:09:21] [scrape:amazon]:   No latest orders. OnlyNew deactivated.
[info] [2024-09-06 00:09:28] [scrape:amazon]:   Logged in
[info] [2024-09-06 00:09:29] [scrape:amazon]:   First possible year: 2024
[info] [2024-09-06 00:09:29] [scrape:amazon]:   Last possible year: 2024
[error] [2024-09-06 00:09:31] [scrape:amazon]:  Couldn't get orderPageCount 1 within 2000ms. Assume only one page.
[info] [2024-09-06 00:09:31] [scrape:amazon]:   Page count: 1
[info] [2024-09-06 00:09:31] [scrape:amazon]:   Processing year "2024" page 0
[info] [2024-09-06 00:09:31] [scrape:amazon]:   Checking page 0 for orders
[info] [2024-09-06 00:09:31] [scrape:amazon]:   Got 0 orders. Processing...
[info] [2024-09-06 00:09:31] [scrape:amazon]:   Page "0" done. Skipping to next page.
[info] [2024-09-06 00:09:32] [scrape:amazon]:   Year "2024" done. Skipping next years
[info] [2024-09-06 00:09:32] [scrape:amazon]:   Processing done. Processed 0 invoices in 0.00 minutes.
[info] [2024-09-06 00:09:32] [scrape:amazon]:   Recurring activated. Not terminating. Waiting for next run.
Disane87 commented 2 months ago

Could you send me the config (it will be put out when log level is DEBUG)? Please be aware to remove your mail and pass :)

stefano1986 commented 1 month ago

Same error here… looks like, if we cant completely deactivate 2FA in Amazon Account. 2FA is deactived in Amazon Account but still sends sms with OTP. config is the original from your docker example … -e AMAZON_USERNAME='[ MAIL]' \ -e AMAZON_PASSWORD='[ PW]' \ -e AMAZON_TLD='de' \ -e AMAZON_YEAR_FILTER='2024' \ -e AMAZON_PAGE_FILTER='1' \ -e LOG_LEVEL='debug' \ …

Disane87 commented 2 weeks ago

I've faced the same issue in another task. 2FA was off and Passkeys were also deactivated. After opening amazon with a an inprivate session of a random browser that issue was magically gone.

But if that persists, I cureently don't have any idea to get over this.