Simple amazon review scraper to extract product reviews (rating, reviews, etc).
The scraper requires ChromeDriver to run and execure necessary HTTP request. https://sites.google.com/a/chromium.org/chromedriver/
The drives is included as part of the source code that can be extracted in the current directory. Othwerise, download it from the link above.
It is important to place the .exe file in the root directoy of this project.
-
Install Requirements
pip3 install -r dependencies.txt
-
Add Amazon Product ASIN to products.txt Product ASIN (Amazon Standard Identification Number) An ASIN is a 10-character alphanumeric unique identifier that is assigned to each product on amazon.
Examples:
- https://www.amazon.in/Grand-Theft-Auto-V-PS4/dp/
B00L8XUDIC
/ref=sr_1_1 - https://www.amazon.in/Renewed-Sony-Cybershot-DSC-RX100-Digital/dp/
B07XRVR9B9
/ref=lp_20690678031_1_14?srs=20690678031&ie=UTF8&qid=1598553991&sr=8-14
- https://www.amazon.in/Grand-Theft-Auto-V-PS4/dp/
-
Update if necessary the
amazon_site
,sleep_time (optional)
,start_page (optional)
,end_page (optional)
arguments inamazon-review-scraper.py
Examples
review_scraper = amazon_review_scraper(amazon_site="amazon.com", product_asin=product_asin.strip(), sleep_time=3, end_page=2)
-
Run
python amazon-review-scraper.py
-
Get data from [amazon_product_asin].csv]
The solution was inspired by https://github.com/scrapehero-code/amazon-review-scraper and https://github.com/SinghalHarsh/amazon-product-review-scraper repositories.