文章详情
接入指南 - 代码 - Nodejs - puppeteer
// 请安装 puppeteer v1.12.2 (详见 https://github.com/GoogleChrome/puppeteer/issues/4143)

const puppeteer = require("puppeteer");

// 代理服务器
const proxyHost = "tunnel.quqiquqi.com";
const proxyPort = 8600;
const proxyServer = "http://" + proxyHost + ":" + proxyPort;

// 隧道验证信息
const proxyUser = "U123456789";
const proxyPass = "P123456789";

(async () => {
    const browser = await puppeteer.launch({
        ignoreHTTPSErrors: true,
        headless: false,
        args: ["--proxy-server=" + proxyServer]
    });

    const page = await browser.newPage();

    await page.authenticate({ username : proxyUser, password : proxyPass});

    try {
        await page.goto("https://www.quqiquqi.com/test", {timeout: 3000});
    }
    catch(err) {
        console.log(err);
    }
})();              
发布时间:2021-10-02

在线客服