amazon_scraper icon indicating copy to clipboard operation
amazon_scraper copied to clipboard

Average Review Rating

Open trentniemeyer opened this issue 9 years ago • 1 comments

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?

trentniemeyer avatar Jan 15 '16 21:01 trentniemeyer

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.

adamlwgriffiths avatar Jan 17 '16 11:01 adamlwgriffiths