Phantom基本身份验证node.js

时间:2018-08-24 10:20:08

标签: node.js authentication phantomjs basic-authentication

我需要使用phantom(node.js)通过基本身份验证 我应该在哪里写我的用户名并通过? const phantom = require('phantom')

(async function(){
    var instance = await phantom.create();
    // instance.settings.userName = "admin";
    // instance.settings.password = "admin"
    var page = await instance.createPage();
    // page.settings.userName = "admin";
    // page.settings.password = "admin";
    const status = await page.open("https://192.168.0.1")
    console.log(status)
    await page.evaluate(function () {
        });

    await page.render('scraper.png')
    await instance.exit()
})();

0 个答案:

没有答案