drawrowfly / amazon-product-api

Amazon Scraper. Scrape products from the amazon search result or reviews from the specific product
627 stars 181 forks source link

Multiple selector issues #46

Closed restyler closed 3 years ago

restyler commented 3 years ago

Hello, I noticed that recently the scraper is not working properly, for example, for products request, it way return zero json nodes for products.

After investigation it turned out that priceSearch ( const priceSearch = $(`div[data-asin=${key}] span[data-a-size="l"]`)[0] || $(`div[data-asin=${key}] span[data-a-size="m"]`)[0]) is not working anymore for xbox product search on amazon US.

Adding $(`div[data-asin=${key}] span[data-a-size="base_plus"]`)[0] to productSearch seems to mitigate the issue.

But I also noticed the same situation with product reviews, as well. Ratings breakdown is returned fine, but no text reviews are returned at all.

Do you see the same issue on your side? Is it Amazon changing its markup all the time?

restyler commented 3 years ago

I fixed it on my side, the issue was related to mobile user agent. Nevermind.