使用PhantomJs,如何获取和处理新页面?

时间:2016-08-01 12:45:10

标签: phantomjs

源代码:

page.open(url, function(status) {

    page.evaluate(function() {

         //jump to a new page, I want to get and handle this page 
        $('.imgItem .maskWraper').eq(0).click();


    });

    console.log(status);

    phantom.exit();
});

我使用PhantomJs加载页面,然后我得到了botton并单击,此按钮跳转到新页面,如何获取此新页面?以及如何继续在新页面上进行互动,例如:

newPage.evaluate(function() {
    button.click();
});

0 个答案:

没有答案