Posts

Showing posts with the label Puppeteer

Bypassing CAPTCHAs With Headless Chrome Using Puppeteer

Answer : Try generating random useragent using this npm package. This usually solves the user agent-based protection. In puppeteer pages can override browser user agent with page.setUserAgent var userAgent = require('user-agents'); ... await page.setUserAgent(userAgent.toString()) Additionally, you can add these two extra plugins, puppeteer-extra-plugin-recaptcha - Solves reCAPTCHAs automatically, using a single line of code: page.solveRecaptchas() NOTE: puppeteer-extra-plugin-recaptcha uses a paid service 2captcha puppeteer-extra-plugin-stealth - Applies various evasion techniques to make detection of headless puppeteer harder. Here is a list of things I'm doing to bypass the captchas and similar blockings: Enable stealth mode (via puppeteer-extra-plugin-stealth) Randomize User-agent or Set a valid one (via random-useragent) Randomize Viewport size Skip images/styles/fonts loading for better performance Pass "WebDriver check" Pass "Chrome c...