chrismbryant / amazon-confidence-interval

A browser extension which adds Bayesian visualizations to Amazon ratings.
MIT License
31 stars 4 forks source link

Scraping fails to find rating sometimes #14

Closed musicin3d closed 4 years ago

musicin3d commented 4 years ago

https://www.amazon.com/s?k=contact+solution

Uncaught (in promise) TypeError: Cannot read property 'innerText' of null at ./src/chrome/inject.js.window.injectConfidenceInterval (VM4917 inject.js:127921) at Module../src/chrome/inject.js (VM4917 inject.js:127935) at __webpack_require__ (VM4917 inject.js:20) at VM4917 inject.js:84 at VM4917 inject.js:87

musicin3d commented 4 years ago

It turns out that some products don't have any reviews. Shocker, I know. It's easy enough to ignore those products, which is what I'm doing in the upcoming pull request for https://github.com/chrismbryant/amazon-confidence-interval/issues/9

aeciorc commented 4 years ago

I can't replicate this one. The selector "div.a-section.a-spacing-none.a-spacing-top-micro>.a-row.a-size-small" is for the ratings itself, so technically there shouldn't be products without any reviews (unless it's actually matching another random element on the page). We access innerText for the rating and the number of reviews, which of these did the error refer to?

musicin3d commented 4 years ago

I don't remember the specifics anymore. Regardless, it won't be an issue anymore