【发布时间】:2017-10-06 04:04:11
【问题描述】:
希望你一切都好,
目的:页面加载完毕后截图
已尝试:已尝试等待一些 MS,当找到 id 时使用 SS。 但它现在不起作用......
casper.waitFor(function StepOne() {
casper.wait(25000, function () {
casper.echo('after 25 sec');
casper.capture('screenshots/SS1.png');
});
casper.waitForSelector('#Row1',
function success() {
casper.CustomEcho('ID FOUND');
casper.capture('screenshots/SS2.png');
},
function fail() {
console.log("oops! ID is not Found..!.");
}
);
return true;
}, function StepTwo() {
casper.capture('screenshots/I_Am_in_Then_SS3.png');
casper.CustomEcho('*****_exit_*********');
casper.exit();
});
提前致谢!
【问题讨论】:
-
你可以在运行脚本后发布你在控制台中打印的内容吗?
-
如代码所示(casper.echo & casper.CustomEcho(UDF))
-
你得到
screenshots/I_Am_in_Then_SS3.png或ID FOUND -
是的,但该语句之后的屏幕截图完全空白(带有白色背景)!
-
网址是HTTPS吗?如果是这样,请在 cmd 行中使用
--ignore-ssl-erros=true
标签: javascript casperjs