V
V
Vladik21092022-02-04 03:26:28
JavaScript
Vladik2109, 2022-02-04 03:26:28

How to properly connect a proxy in puppeteer?

Hello everyone, when connecting a proxy in puppeteer, it gives an error

(async function main() {

    const browser = await puppeteer.launch({
        args: [ '--proxy-server=155.138.150.199:23456' ]
    });
    const page = await browser.newPage();

    await page.goto('https://weeklyad.target.com/promotions?page=49', { waitUntil: 'networkidle0' });

        await page.screenshot({
            fullPage: true,
            path: 2+'.jpeg'
        });

        await browser.close();

})();


Error:
\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:155 ? new Error(${response.errorText} at ${url})

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question