CasperJS(phantom 1.9.7),从昨天起就无法连接https

CasperJS (phantom 1.9.7), connection https is not possible since yesterday

本文关键字:昨天 https 连接 phantom CasperJS      更新时间:2023-09-26

从昨天开始,我在CasperJS和一个网站上遇到了问题。实际上,从昨天开始就不可能连接服务器了。但是,我在windows上的脚本运行良好。我的生产服务器上有这个错误:

2015-04-01T09:46:02〔调试〕网页-更新加载进度:102015-04-01T09:46:02[DEBUG]网络-资源请求错误:2("连接关闭")URL:"https://www.mysite.fr/"[error][phantom]资源https://www.mysite.fr/未能加载(null)2015-04-01T09:46:02〔调试〕网页-更新加载进度:100

我使用:

casperjs --ssl-protocol=tlsv1 --ignore-ssl-errors=yes --web-security=no --debug=yes script.js 

所以,在windows(1.9.7)中,功能非常完美,但从昨天开始,我的linux上的脚本就不能像上面的输出那样工作了。

请尝试

casperjs --ssl-protocol=any script.js

替代方法:更新至PhantomJS 1.9.8或更高版本的

你可以用

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo npm install -g casperjs

这是唯一对我有效的方法:

casperjs test.js --config=<(echo '{"sslProtocol": "any"}') --ignore-ssl-errors=true

PhantomJS 2.1,CasperJS 1.1