iCh*_*hux 5 phantomjs casperjs
从Casperjs 访问https://disqus.com/profile/login/链接会继续返回以下内容
[警告] [幻像]加载资源失败,状态=失败:https: //disqus.com/profile/login/
ensnare.js
var casper = require("casper").create({
verbose: true,
logLevel: "debug"
});
casper.options.timeout = 15000;
casper.start("https://disqus.com/profile/login/", function() {
this.echo("YES!", "GREEN_BAR");
this.echo(this.getTitle());
});
casper.run();
Run Code Online (Sandbox Code Playgroud)
config.json
{"ignoreSslErrors": true, "cookiesFile": "biscuit", "maxDiskCacheSize": 1000, "diskCache": true}
Run Code Online (Sandbox Code Playgroud)
请注意,我将"ignoreSslErrors"更改为false,但它不起作用.
从终端调用脚本
./phantomjs --config=config.json casperjs/bin/bootstrap.js --casper-path=casperjs --cli ensnare.js
Run Code Online (Sandbox Code Playgroud)
截图
我怎么解决这个问题呢?我可以无问题地访问其他页面.
Prz*_*eoR 14
试试这个(它在Mac OS X上帮助我):
casperjs --debug=yes --ignore-ssl-errors=true --ssl-protocol=any XYZ.jRun Code Online (Sandbox Code Playgroud)
XYZ.js是你的文件.