当我运行phantomjs filename.js
或phantomjs --ssl-protocol=any filename.js
我得到:status: fail
但确实可以打开网址。
这是我的代码:
var page = require('webpage').create();
var fs = require('fs');
var system = require('system');
var u='https://sites.google.com/site/nurailcenter/research/nurail2012-uic-r06'
page.open(u, function(status){
console.log("status: " + status);
if(status === "success"){
fs.write('result.html', page.content, 'w');
}
phantom.exit();
});