I’m having issues with Puppeteer and Cloudflare’s human verification. It keeps looping, even when I try to solve it by hand or use a bypass extension. This used to work fine before.
I think it might be related to proxy or captcha-solving extensions. I’ve noticed similar problems in regular Chrome after adding certain extensions.
Here’s what I’ve tried:
- Running Puppeteer with different browsers (Chrome, Chromium, Brave, Opera)
- Setting custom user agents and headers
- Clearing cache and cookies
- Using puppeteer-extra and puppeteer-extra-plugin-stealth
Here’s a basic version of my code:
const puppeteerExtra = require('puppeteer-extra');
const Stealth = require('puppeteer-extra-plugin-stealth');
puppeteerExtra.use(Stealth());
(async () => {
const browser = await puppeteerExtra.launch({
headless: false,
args: ['--proxy-server=myproxy.example.com:8080'],
});
const page = await browser.newPage();
await page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36');
await page.setExtraHTTPHeaders({
'Accept-Language': 'en-US,en;q=0.9',
});
await page.authenticate({
username: 'proxyuser',
password: 'proxypass',
});
await page.goto('https://example.com/login', {
waitUntil: 'networkidle2',
timeout: 0,
});
await page.type('#email', '[email protected]');
await page.type('#password', 'mypassword');
await page.click('#login-button');
await page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 0 });
await page.screenshot({ path: 'result.png' });
})();
I’m stuck on the Cloudflare page, which keeps looping even after manual solving. Any ideas on how to fix this?