google finds my browser is being manipulated/controlled/automated by software, and because of that I get captchas. I start chromium manually and do the same steps the captchas doesn't appear.
Question 1)
Is it possible to solve captcha Programmatically or get rid of it when using puppeteer? Any way to solve this?
Question 2)
Does this happens only when without headless option i.e
const browser = await puppeteer.launch({
headless: false
})
OR this is something the fact we have to accept and move on?
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 randomUseragent = require('random-useragent');
...
await page.setUserAgent(randomUseragent.getRandom())
Additionally, you can add these two extra plugins,
puppeteer-extra-plugin-recaptcha - Solves reCAPTCHAs automatically, using a single line of code: page.solveRecaptchas()
puppeteer-extra-plugin-stealth - Applies various evasion techniques to make detection of headless puppeteer harder.
Have you tried setting the browser agent?
await page.setUserAgent('5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36');
来源:https://stackoverflow.com/questions/55678095/bypassing-captchas-with-headless-chrome-using-puppeteer