Error scraping Amazon images

Hello.

When I scan the images of Amazon products, some of them show the correct URL, but most of them show data like this:

data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAwMDQsNCxAODBANEA4QExYRDRASGR8dFhsVHhgYEx4YFRsVFBwYGyAZHhsjKyQpIyA6LCYxGSYoRC5FOUsyLkIBCA4NDhITDhERExMREhYTJxsSES4cHR8TKQsfERYeFhcfEBYZHBAXIRcpDCMRCy8gKBwUJxYSERQeFg4bHTAeIP/AABEIAMcBLAMBIgACEQEDEQH/xAC6AAABBAMBAAAAAAAAAAAAAAAEAAIDBQEGBwgQAAEDAgIEBwwFCQcEAwEAAAEAAgMEERIxBSFBUQYTIlJhkbIXMjVxcnN0gbHB0dQUQlOSoRYjJDM2YpPh8AcVNGSCo9OzwsPxJUODogEAAgMBAQAAAAAAAAAAAAAAAAQCAwUBBhEAAQMCAwUFBwMEAAcAAAAAAQACEQMhEjFBBFFhcYEiMqHB4RNCYnKRsfAFFNEzUoKyI0Njc7PC0v/aAAwDAQACEQMRAD8A6bpbSkWjojcsD7BznPuWtBJAJDeU4uIOFozsdYFytCn4U6Te/wDRp5GM6Y4/YQ7tIPhNI+TTtViJwh7GMZuwxM9pJVBddQtlHCfTO2ok+5F/xJ44U6U2zTdUPy61W7ua7qWLu5rupEoW2/lXpDn1H+z8qs/lZXb6rrh+UWoXPNd1Jt3c13UiULcvyurP831wfJpflfV/5v70Hya0y55rupNu7mu6kShbp+V9Vuq/vwfJJflhVbqz78HyS0ok7isXO4oQt1/LGp3Vn34PklG/hhXEs4s1TQDeW5gNxuH6GtMudxWLncVxC3f8sqndWffg+SWPyzqd1Z9+D5JaPc7im3O4oQt5/LSp5tb9+D5JY/LSp5tb9+D5JaKS7mu6li55ruooQt7/AC1qObW/fg+SWPy2qOZW/fg+SWh3dzXdSbd3Nd1IQt7k4dTRMxuZXffg+RQvdDk+xrv4sHyC0SrllbDxLA7DKbyC27JVOFwzBXULq..........

instead of: https://images-na.ssl-images-amazon.com/images/I/81cfA-ERo3L.AC_SX450.jpg

Url: Any Amazon.es product

Sitemap:
{"_id":"telegramazon","startUrl":["https://colombiatrabajos.blogspot.com/2020/10/url.html"],"selectors":[{"id":"index","type":"SelectorLink","parentSelectors":["_root"],"selector":".post-body a","multiple":true,"delay":0},{"id":"asin","type":"SelectorLink","parentSelectors":["index"],"selector":"a.\35 star","multiple":false,"delay":0},{"id":"title","type":"SelectorText","parentSelectors":["index"],"selector":"span#productTitle","multiple":false,"regex":"","delay":0},{"id":"precioant","type":"SelectorText","parentSelectors":["index"],"selector":"span.priceBlockStrikePriceString","multiple":false,"regex":"","delay":0},{"id":"precioferta","type":"SelectorText","parentSelectors":["index"],"selector":"span.priceBlockBuyingPriceString","multiple":false,"regex":"","delay":0},{"id":"precioferta2","type":"SelectorText","parentSelectors":["index"],"selector":"span.priceBlockDealPriceString","multiple":false,"regex":"","delay":0},{"id":"precioferta3","type":"SelectorText","parentSelectors":["index"],"selector":"span.priceBlockSalePriceString","multiple":false,"regex":"","delay":0},{"id":"img1","type":"SelectorImage","parentSelectors":["index"],"selector":"img.a-stretch-horizontal","multiple":false,"delay":0},{"id":"img2","type":"SelectorImage","parentSelectors":["index"],"selector":"img.a-stretch-vertical","multiple":false,"delay":0},{"id":"descripcion","type":"SelectorText","parentSelectors":["index"],"selector":".a-spacing-mini li:nth-of-type(n+2) span","multiple":true,"regex":"","delay":0},{"id":"categoria","type":"SelectorText","parentSelectors":["index"],"selector":"li:nth-of-type(1) a.a-color-tertiary","multiple":false,"regex":"","delay":0}]}

Thanks.

This is a valid URL and it is a way of embedding images in HTML. Sites do this mainly for performance. You'd need some kind of post-processing to turn it back into jpg.

Ref:


Thanks for reply.

I have tried to decode to image but it always gives error.

The funny thing is that if I make two scans to the same products, some where the image appeared in base64 then appear in the usual image format, and vice versa.