需要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();
    });
}  发布于 2018-03-29 09:24:43
应该继续加载页面,就像在没有SSL错误的情况下那样:
phantomjs --ignore-ssl-errors=yes [phantomOptions] script.js [scriptOptions]https://stackoverflow.com/questions/-100003732
复制相似问题