不能在phantomjs中延迟加载

时间:2013-11-08 11:25:41

标签: web-scraping lazy-loading phantomjs casperjs

我正在尝试从涉及延迟加载的链接(http://www.myntra.com/women-sarees?nav_id=606)中抓取一些信息。以下是我的代码段:

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

但是我只加载了前6行。我不明白我哪里错了。

0 个答案:

没有答案