not able to lazy load in phantomjs

烂漫一生 提交于 2019-12-14 04:19:10

问题


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.

来源:https://stackoverflow.com/questions/19857961/not-able-to-lazy-load-in-phantomjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!