Bypassing CAPTCHAs with Headless Chrome using puppeteer

后端 未结 4 1456
遇见更好的自我
遇见更好的自我 2020-12-14 04:35

google finds my browser is being manipulated/controlled/automated by software, and because of that I get reCaptcha. When I manual star

4条回答
  •  一整个雨季
    2020-12-14 05:18

    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.

提交回复
热议问题