[Bug] puppeteer stealth mode is not working with browser.pages
See original GitHub issueStealth mode is not working with array of pages
I am using stealth mode in chrome headful and its working but when I change to headless the stealth mode didn’t work with it, I have figured the problem because I using array of pages and I have to use this in that way for other isseues with bot detection.
const puppeteer = require('puppeteer-extra')
const StealthPlugin = require('puppeteer-extra-plugin-stealth')
puppeteer.use(StealthPlugin())
;(async () => {
const browser = await puppeteer.launch({
headless: true,
executablePath: '/path/to/Chrome'
})
const [ page ] = await browser.pages()
await page.goto('https://bot.sannysoft.com')
await page.waitForTimeout(5000)
await page.screenshot({ path: 'testresult.png', fullPage: true })
await browser.close()
})()
Versions puppeteer-extra@3.1.18 puppeteer-extra-plugin-user-preferences@2.2.12
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
How to use the puppeteer-extra.launch function in ... - Snyk
To help you get started, we've selected a few puppeteer-extra examples, based on popular ways it is used in public projects. Secure your...
Read more >Download not working on Stealth Plugin with used with ...
The problem: Once the button is clicked, nothing happens, no download is initiated. Basically, removing puppeteer.use(StealthPlugin()) makes the ...
Read more >puppeteer-extra-plugin-stealth - npm
Stealth mode : Applies various techniques to make detection of headless puppeteer harder.. Latest version: 2.11.1, last published: 5 months ...
Read more >Troubleshooting - Puppeteer
The most common cause is a bug in Node.js v14.0.0 which broke extract-zip , the module Puppeteer uses to extract browser downloads into...
Read more >Avoid being blocked with puppeteer - Cobalt Intelligence
One of the main questions I see on forums and reddit with regards to web scraping is…”how do I avoid being blocked?”. This...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the default page does not have plugin enabled
let page = await browser.newPage(); let pages = await browser.pages(); const oldPage = pages[0]; oldPage.close();
I do this to have only one page, butconst page = await browser.newPage();
should be fine for headlessSince we the headless stealth is not working on default page, i.e.
const page = (await browser.pages())[0]
, we cannot use the incognito page actually, sincebrowser.newPage()
opens up a new page in a non-incognito context