如何在无头模式下使用木偶消除SSL证书检查/错误?

尝试以下代码,但出现错误。

  

错误:net :: ERR_SSL_VERSION_OR_CIPHER_MISMATCH位于   https://www.xxxxxxsolutions.com/

const puppeteer = require('puppeteer');
(async () => {
    const browser = await puppeteer.launch({ignoreHTTPSErrors: true,acceptInsecureCerts: true,args: ['--proxy-bypass-list=*','--disable-gpu','--disable-dev-shm-usage','--disable-setuid-sandbox','--no-first-run','--no-sandbox','--no-zygote','--single-process','--ignore-certificate-errors','--ignore-certificate-errors-spki-list','--enable-features=NetworkService']});
    const page = await browser.newPage();
    try {

        await page.goto('https://www.xxxxxxxsolutions.com/',{waitUntil: 'networkidle2',timeout: 59000});
        const cookies = await page._client.send('Network.getallCookies');
        JSON.stringify(cookies,null,4);
    } catch (e) {
        console.log(e);
    }

    await browser.close();
})();

如何在无头模式下使用木偶消除SSL证书检查/错误?

beautytai 回答:如何在无头模式下使用木偶消除SSL证书检查/错误?

@mujuonly,这是与版本有关的问题。请尝试使用高于1.16.0或最新版本2.0的相同代码。一切正常。

本文链接:https://www.f2er.com/3152932.html

大家都在问