gajus / puppeteer-proxy

Proxies Puppeteer Page requests.
Other
201 stars 25 forks source link

Error: net::ERR_FAILED #26

Open thisiseddy-ab opened 1 year ago

thisiseddy-ab commented 1 year ago

Im Trying for the first time the puppeteer-proxy lib,and Im getting this error. I don know is an error of puppeteer-proxy or of the function await page.setRequestInterception(true) because this guy has the same error as me

Code

const puppeteer = require('puppeteer-extra')
const StealthPlugin = require('puppeteer-extra-plugin-stealth')
const {proxyRequest} = require('puppeteer-proxy')

puppeteer.use(StealthPlugin())
var browser = null

const func = (async () => {
    browser = await puppeteer.launch({ 
        headless: false,
        executablePath: "chrome-win/chrome.exe"
    })

    const page = await browser.newPage()

    await page.setRequestInterception(true);

    page.on('request', async (request) => {
        await proxyRequest({
        page,
        proxyUrl: "https://username:password@174.25.210.207:6286",
        request,
        });
    });

    await page.goto("https://www.google.com/")

})();

Error

C:\Users\edina\Documents\Last Developer Projects\Scraping Browser\node_modules\puppeteer-core\lib\cjs\puppeteer\common\Frame.js:238
                    ? new Error(`${response.errorText} at ${url}`)
                      ^

Error: net::ERR_FAILED at https://www.google.com/
    at navigate (C:\Users\edina\Documents\Last Developer Projects\Scraping Browser\node_modules\puppeteer-core\lib\cjs\puppeteer\common\Frame.js:238:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Frame.goto (C:\Users\edina\Documents\Last Developer Projects\Scraping Browser\node_modules\puppeteer-core\lib\cjs\puppeteer\common\Frame.js:207:21)
    at async CDPPage.goto (C:\Users\edina\Documents\Last Developer Projects\Scraping Browser\node_modules\puppeteer-core\lib\cjs\puppeteer\common\Page.js:439:16)
    at async C:\Users\edina\Documents\Last Developer Projects\Scraping Browser\test.js:28:5
bernatixer commented 10 months ago

Having the same issue with that

ciricc commented 5 months ago

Thats because https://github.com/gajus/puppeteer-proxy/issues/24

sou-long commented 1 week ago

"https://username:password@174.25.210.207:6286"

This old issue is probably resolved, but for future visitors: you may want to use http:// instead of https:// in your proxy connection string. This is a common source of confusion, because proxy type is different from its traffic type. On top of that, proxy providers tag it as "HTTPS" while they may really serve "HTTP". It's likely that 174.25.210.207:6286 was simply an http proxy endpoint (doesn't mean it cannot proxy https, just the proxy protocol itself is http).