3

When trying to get images from web page using cheerio and these images displayed using lazy load style the scraped images not the real one exist in web page. All images displayed with base64 encode and this not a real image it's the effect of lazy load. How can i solve this problem and get the real images which appears after scroll the web page ? all scraped images appears like this

<img class="card-img-top" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMAQObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=" id="card-img">
Ahmed Mahmoud
  • 1,724
  • 1
  • 17
  • 21
  • 1
    Lazy loading is a JS thing and Cheerio doesn't execute JS. If the base 64 contains the whole image data, you can scrape that attribute, but based on the sample that's likely not the case (and it'd defeat the purpose of lazy loading anyway if the data was present). – ggorlen Nov 26 '22 at 02:27

0 Answers0