tducret / amazon-scraper-python

Non-official client to get some info about products sold on Amazon
MIT License
871 stars 159 forks source link

Added images #16

Closed bitofbreeze closed 5 years ago

bitofbreeze commented 5 years ago

I needed access to image thumbnails for my use case, so I added them with not too much work. Hope this helps!

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 192


Totals Coverage Status
Change from base Build 182: 0.05%
Covered Lines: 161
Relevant Lines: 163

💛 - Coveralls
tducret commented 5 years ago

Thank you very much for your help @CSFlorin ! I am making a few adjustments since I am sometimes getting image url with : data:image/webp;base64,UklGR[...many many characters] I'll commit it soon. I'll also implement a few tweak in the url to get an higher resolution image (as suggested by @DiReKToRje in issue #10)

bitofbreeze commented 5 years ago

Sounds good! I think Amazon may just be a bit disorganized when giving the base64-encoded version or a url to the actual source.

That resizing thing is interesting. You can enter any dimension at the end and there are keys like US and QL to change the aspect ratio. They also seem to have some predefined sizes on the page as can be seen below from the first entry on this page.

<img src="https://images-na.ssl-images-amazon.com/images/I/514PIKUKSnL._AC_US218_.jpg" srcset="https://images-na.ssl-images-amazon.com/images/I/514PIKUKSnL._AC_US218_.jpg 1x, https://images-na.ssl-images-amazon.com/images/I/514PIKUKSnL._AC_US327_FMwebp_QL65_.jpg 1.5x, https://images-na.ssl-images-amazon.com/images/I/514PIKUKSnL._AC_US436_FMwebp_QL65_.jpg 2x, https://images-na.ssl-images-amazon.com/images/I/514PIKUKSnL._AC_US500_FMwebp_QL65_.jpg 2.2935x" width="218" height="218" alt="Coca-Cola, 7.5 fluid Ounces, 6 Pack" class="s-access-image cfMarker" data-search-image-load="">
tducret commented 5 years ago

17 closes this issue

tducret commented 5 years ago

Everything is now in order :) You may upgrade the pip package and docker image.