Open git37 opened 11 months ago
Same happens to me too.
+1 Once again, the issue has emerged today !
+1
I've just started using this and I get the same, I've noticed if I set headless: false it works but when I run in headless I get the "browser or app may not be secure" message
I've just started using this and I get the same, I've noticed if I set headless: false it works but when I run in headless I get the "browser or app may not be secure" message
for me it is also with headless=false, but it seems like this repo isn't maintained anymore...
No solution found yet :/ . Still working on it. Any suggestions welcome.
Does anyone have any updates?
The issues is caused by the stealth plugin.
I narrowed it down and you need to delete those 2 evasions:
const stealthPlugin = stealth() stealthPlugin.enabledEvasions.delete('iframe.contentWindow'); stealthPlugin.enabledEvasions.delete('media.codecs')
Also using: args: ['--disable-blink-features=AutomationControlled']
This does not work for me - do you have any idea?
import puppeteer from 'puppeteer-extra' import { PuppeteerNodeLaunchOptions, Browser, Page, ElementHandle } from 'puppeteer' import fs from 'fs-extra' import path from 'path' const StealthPlugin = require('puppeteer-extra-plugin-stealth')() StealthPlugin.enabledEvasions.delete('iframe.contentWindow') StealthPlugin.enabledEvasions.delete('navigator.plugins') StealthPlugin.enabledEvasions.delete('media.codecs') puppeteer.use(StealthPlugin)
This does not work for me - do you have any idea?
import puppeteer from 'puppeteer-extra' import { PuppeteerNodeLaunchOptions, Browser, Page, ElementHandle } from 'puppeteer' import fs from 'fs-extra' import path from 'path' const StealthPlugin = require('puppeteer-extra-plugin-stealth')() StealthPlugin.enabledEvasions.delete('iframe.contentWindow') StealthPlugin.enabledEvasions.delete('navigator.plugins') StealthPlugin.enabledEvasions.delete('media.codecs') puppeteer.use(StealthPlugin)
![]()
I same issue.
This does not work for me - do you have any idea?
`import puppeteer from 'puppeteer-extra'
import { PuppeteerNodeLaunchOptions, Browser, Page, ElementHandle } from 'puppeteer'
import fs from 'fs-extra'
import path from 'path'
const StealthPlugin = require('puppeteer-extra-plugin-stealth')()
StealthPlugin.enabledEvasions.delete('iframe.contentWindow')
StealthPlugin.enabledEvasions.delete('navigator.plugins')
StealthPlugin.enabledEvasions.delete('media.codecs')
puppeteer.use(StealthPlugin)
`
![]()
try also args: ['--disable-blink-features=AutomationControlled']
Doesn't work as well...
same issue. +1
+1
+1
Well guys, without testing it, i have an idea. Log which userAgent you are using. This err looks to me like a outdated Useragent...
It's definitely not the Useragent for most people -- quickest thing I ruled out on my end for most sites. Multiple other bot-detection sites started detecting Puppeteer-extra-stealth too. I strongly feel it's somehow detecting it via javascript
any update for this issue? I am facing same issue for headless mode while headful mode works well with stealth plugin.
If there is a "--disable-notifications" option in args Try removing it. By removing this option, it worked.
code: `const puppeteer = require("puppeteer-extra"); const StealthPlugin = require("puppeteer-extra-plugin-stealth"); const AnonymizeUAPlugin = require("puppeteer-extra-plugin-anonymize-ua"); const AdblockerPlugin = require("puppeteer-extra-plugin-adblocker"); const path = require("path");
puppeteer.use(StealthPlugin()); puppeteer.use(AnonymizeUAPlugin()); puppeteer.use( AdblockerPlugin({ blockTrackers: true, }) ); const crawler = async () => { const browser = await puppeteer.launch({ headless: false, defaultViewport: null, ignoreDefaultArgs: ["--disable-extensions"], args: [ "--start-maximized", "--no-sandbox", "--disable-setuid-sandbox", "--user-data-dir=${path.join(__dirname, "dev-user-data")}", ], }); const page = await browser.newPage(); let login_link = "https://google.com/"; await page.goto(login_link); };`
@onepunch-tk it's really works!
+1
+1
Has worked for over a year without any problems.
No problems if I connect from a browser.
Unfortunately, not working here. Does someone still has this issue?
send full code to reproduce
better compile everything in one file
Ignore the OpenAI part, it works fine. The problem is after the email input.
const puppeteer = require("puppeteer-extra");
const StealthPlugin = require("puppeteer-extra-plugin-stealth");
const AnonymizeUAPlugin = require("puppeteer-extra-plugin-anonymize-ua");
const AdblockerPlugin = require("puppeteer-extra-plugin-adblocker");
puppeteer.use(StealthPlugin());
puppeteer.use(AnonymizeUAPlugin());
puppeteer.use(
AdblockerPlugin({
blockTrackers: true,
})
);
const browser = await puppeteer.launch({
headless: true,
defaultViewport: null,
ignoreDefaultArgs: ["--disable-extensions"],
dumpio: true,
args: ["--start-maximized", "--no-sandbox", "--disable-setuid-sandbox"],
executablePath: "/Applications/Chromium.app/Contents/MacOS/Chromium",
});
const page = await browser.newPage();
// OpenAI Stuff
await page.goto("https://platform.openai.com/usage", {
waitUntil: "networkidle2",
});
await page.waitForSelector("button");
await page.click("button")[0];
await page.waitForSelector(".social-btn");
try {
await page.evaluate(() => {
const elements = document.querySelectorAll(".social-btn");
elements.forEach((element) => {
if (element.innerHTML.includes("Google")) {
element.click();
}
});
});
} catch (error) {
await page.click("form[data-provider] button")[1];
}
// Google Stuff
await page.waitForNavigation();
await page.waitForSelector('input[type="email"]');
await page.type('input[type="email"]', "test@test.com", { delay: 30 });
await page.keyboard.press("Enter");
page
.waitForSelector('input[type="password"]', { visible: true })
.then(async () => {
await page.type('input[type="password"]', "test");
await page.keyboard.press("Enter");
});
Remove this puppeteer.use(StealthPlugin());
And add this
const stealth = StealthPlugin()
stealth.enabledEvasions.delete('iframe.contentWindow')
stealth.enabledEvasions.delete('media.codecs')
puppeteer.use(stealth)
Nice! It worked. But seems like I have to figure out how to bypass the captcha...
[Bug] "This browser or app may not be secure" appears again when trying to login to google