Skip to content
This repository has been archived by the owner on Dec 23, 2018. It is now read-only.

Average Review Rating #23

Open
trentniemeyer opened this issue Jan 15, 2016 · 1 comment
Open

Average Review Rating #23

trentniemeyer opened this issue Jan 15, 2016 · 1 comment

Comments

@trentniemeyer
Copy link

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 trentniemeyer reopened this Jan 15, 2016
@trentniemeyer trentniemeyer changed the title Average Rating Average Review Rating Jan 15, 2016
@adamlwgriffiths
Copy link
Owner

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants