amazon_scraper
amazon_scraper copied to clipboard
Average Review Rating
I didn't see this existed, so I tried parsing it out myself.
avg_rating = float(rs.soup.find("i", {'class':re.compile('averageStarRating')}).text.split(' ')[0])
Should I submit a pull request?
Yes, a PR would be fine. Please ensure there are a few tests for different products.
If the averageStarRating
node isn't available, it can fall back to using a calculation based on the ratings array.
I'm not sure if the current ratings
work anymore, I've noticed amazon moving to a single average score with a total review count rather than count per star.