Open wolleakira opened 4 years ago
I have the same issue! It used to work fine (a few weeks ago) but I see the same error right now. Would you great if anybody can help fixing this?
Looks like Amazon has begun blocking these requests. The Robots.txt file shows the customer reviews are Disallowed. They appear to be pushing folks to the Product Advertising API which requires you to be a seller or have a e-commerce site to pull the data. Hopefully I'm wrong, but based on the information that came back on the query it appears that is what is going on.
Sorry, we just need to make sure you're not a robot. For best results, please make sure your browser is accepting cookies.
Definitely getting blocked here. You may want to change the User-Agent
In reviews.py if we add one more condition in if then It will work fine because if verified purchase is blank(None) then it will show error. If we add a condition in if block to check that, the error will be solve. changes:
if 'verified' in r and r['verified'] is not None:
if 'Verified Purchase' in r['verified']:
r['verified'] = 'Yes'
else:
r['verified'] = 'Yes'
else:
r['verified'] = 'No'
You can see I add one more condition in first If and also add a else for outer If.
I installed all the requirements and ran the code for testing without changing the urls or anything and got the following error:
Downloading https://www.amazon.com/Nike-Womens-Reax-Running-Shoes/product-reviews/B07ZPL752N/ref=cm_cr_dp_d_show_all_btm?ie=UTF8&reviewerType=all_reviews Traceback (most recent call last): File "C:/Users/amazon-review-scraper-master/reviews.py", line 46, in for r in data['reviews']: TypeError: 'NoneType' object is not iterable
Could you tell me where the code might need to be changed or what I should do?