1
我卡返回4線這樣的,然後掛在網頁上:casperjs解決方法URL =約:空白willNavigate = TRUE,isMainFrame =假
[debug] [phantom] opening url: https://xxx, HTTP GET
[debug] [phantom] Navigation requested: url=https://xxx, type=Other, willNavigate=true, isMainFrame=true
[info] [phantom] Step anonymous 3/6: done in 170ms.
[debug] [phantom] url changed to "https://xxx"
[debug] [phantom] Navigation requested: url=about:blank, type=Other, willNavigate=true, isMainFrame=false
[debug] [phantom] Navigation requested: url=about:blank, type=Other, willNavigate=true, isMainFrame=false
[debug] [phantom] Navigation requested: url=about:blank, type=Other, willNavigate=true, isMainFrame=false
[debug] [phantom] Navigation requested: url=about:blank, type=Other, willNavigate=true, isMainFrame=false
我推出這樣的命令,因爲我讀幾個SSL相關的錯誤,它適用於整個網站的XXX:
casperjs --ignore-ssl-errors=true --ssl-protocol=any script.js
我的代碼是不是嵌套,因爲它是由我自己的類生成的。然而它很簡單:
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7');
casper.start().then(function() {
this.open('https://xxx', {
headers: {
'Accept': 'text/html'
}
});
});
casper.then(function() {
this.viewport(1920, 1080);
});
casper.wait(
3000,
function() {
this.echo('timeout occured');
}
);
casper.then(function() {
this.capture('capture.png', {
top: 0,
left: 0,
width: 1920,
height: 1080
});
});
casper.run();
我需要專家的提示,不幸我不是。提前謝謝