我是CasperJS的新手。CasperJS - 无法捕捉到完整的网站screenshoot withPopup功能
当我使用withPopup
,好像在弹出的页面没有加载完全...
var casper = require('casper').create({
verbose: true,
})
casper.start('https://www.w3schools.com/js/js_examples.asp').then(function(){
this.capture('try1.png');
this.click('#main p a');
})
casper.waitForPopup(0, function() {
this.capture('try2.png');
}, null, 20000);
casper.withPopup(0, function() {
this.waitForSelector('body', function(){
this.capture('try3.png');
})
});
casper.run(function() {
casper.echo('Done.').exit();
});
初学者'#main p a'返回至少290个锚点元素。其次点击其中的第一个不会显示一个弹出窗口,但会重定向到另一个网址!你想在这里做什么? – Rippo
我只是想尝试一下使用补丁功能,使用点击重定向到另一个页面。 – phaneven