drawrowfly / amazon-product-api

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

Update Amazon.js - Fixing verified purchase check & parsing total number of reviews #89

Open dotrahat opened 1 year ago

dotrahat commented 1 year ago
  1. Selector of verified purchase badge is different on amazon than what is used in this package. So, I Updated Selector where it checks if purchase is verified while scraping reviews and now it gets it correctly.
  2. "Get total number of reviews" didn't get the number correctly if there is a comma in number like 1,345. If comma exists, it only returns the number present before comma (1 in case of 1,345). I added replace function there to get rid of commas before parseInt uses it. So, After I Updated this code now it gets total number of reviews correctly.