PhantomJS未能打开HTTPS站点我正在使用以下代码来打开https:/Site,它也需要http服务器身份验证。var page = require('webpage').create(), system = require('system'), t, address;
page.settings.userName = 'myusername';
page.settings.password = 'mypassword';
if (system.args.length === 1) {
console.log('Usage: scrape.js <some URL>');
phantom.exit();
} else {
t = Date.now();
address = system.args[1];
page.open(address, function (status) {
if (status !== 'success') {
console.log('FAIL to load the address');
} else {
t = Date.now() - t;
console.log('Page title is ' + page.evaluate(function () {
return document.title;
}));
console.log('Loading time ' + t + ' msec');
}
phantom.exit();
});
}它总是无法加载页面。这里有什么问题吗?安全的站点是否有任何不同的处理方式?不过,可以通过浏览器成功地访问该网站。我现在只是从幻影开始,发现它太好了,不能停止玩,即使我没有在这个问题上前进。
3 回答

蓝山帝景
TA贡献1843条经验 获得超7个赞
只有-SSL-Protocol=any选项似乎对我有帮助:
phantomjs --ssl-protocol=any test.js
另外,我认为使用它应该更安全。--ssl-protocol=any
因为你仍然在使用加密,但是--ignore-ssl-errors=true
将忽略所有SSL错误,包括恶意错误。

阿波罗的战车
TA贡献1862条经验 获得超6个赞
许多服务器正在禁用SSLv 3支持。
为了解决这个问题,您应该能够使用以下工具运行PhantomJS:
phantomjs --ssl-protocol=tlsv1
希望能很快更新PhantomJS,使TLSv 1成为默认的,而不是SSLv 3。
- 3 回答
- 0 关注
- 1031 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消