相关疑难解决方法(0)

PhantomJS无法打开HTTPS站点

我正在使用以下基于loadspeed.js示例的代码打开一个https://站点,该站点也需要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();
    });
} …
Run Code Online (Sandbox Code Playgroud)

https screen-scraping phantomjs

103
推荐指数
5
解决办法
7万
查看次数

标签 统计

https ×1

phantomjs ×1

screen-scraping ×1