使用p操纵器通过无头Chrome绕过验证码 [英] Bypassing CAPTCHAs with Headless Chrome using puppeteer
问题描述
google
发现我的浏览器正在由软件进行操纵/控制/自动化
,因此,我得到了 reCaptcha
.当我手动启动铬并执行相同的步骤时,不会出现reCaptcha.
google
finds my browser is being manipulated/controlled/automated
by software, and because of that I get reCaptcha
. When I manual start chromium and do the same steps the reCaptcha doesn't appear.
问题1)
使用 puppeteer
时是否可以以编程方式解决验证码或摆脱验证码?有什么办法解决这个问题?
Is it possible to solve captcha Programmatically or get rid of it when using puppeteer
? Any way to solve this?
问题2)
只有在没有 headless
选项 i.e
const browser = await puppeteer.launch({
headless: false
})
这是我们必须接受并继续前进的事实吗?
OR this is something the fact we have to accept and move on?
推荐答案
尝试使用此 npm程序包生成随机useragent.通常,这可以解决基于用户代理的保护.
Try generating random useragent using this npm package. This usually solves the user agent-based protection.
在伪造者页面中,页面可以使用 page.setUserAgent
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-captra page.solveRecaptchas()
注意: puppeteer-extra-plugin-recaptcha
使用付费服务 2captcha
puppeteer-extra-plugin-stealth -应用各种规避技术使得对无头木偶的探测更加困难.
puppeteer-extra-plugin-stealth - Applies various evasion techniques to make detection of headless puppeteer harder.
这篇关于使用p操纵器通过无头Chrome绕过验证码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!