I'm trying to scrape some information from the link (http://www.myntra.com/women-sarees?nav_id=606) that involves lazy loading. Below is my code snippet for this:
window.setInterval(function() {
//var count returns the visibility of the div that checks for lazyloading
if((count == 'none')) { // more products to be loaded
page.evaluate(function() {
// Scrolls to the bottom of page
window.document.body.scrollTop = document.body.scrollHeight;
});
page.render('myn'+k+'.png');
}
else { // Found
//Do what you want
//console.log('len123');
}, 5000); // Number o ms to wait between scrolls
But I'm getting only first 6 rows loaded. I don't understand where am I going wrong.