2

我正在尝试从涉及延迟加载的链接( 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 行。我不明白我哪里错了。

4

0 回答 0