Closed apulidoc closed 3 years ago
example simulating the problem.
Try to purge or remove userDataDir
.
example simulating the problem.
Try to purge or remove
userDataDir
. But cannot reproduce
it worked, thank you.
Seems like cached somewhere in cookies or local storage that you are a bot
Seems like cached somewhere in cookies or local storage that you are a bot
delete folder and tried again
@vladtreny i made the more test.
The packages what i use are:
"puppeteer-core": "^3.3.0", "puppeteer-extra": "^3.1.15", "puppeteer-extra-plugin-stealth": "^2.6.5"
The launch options are:
const launchOptions = Object.assign({
dumpio: false, headless: false, defaultViewport: null, devtools: false,
args: [
`--disable-dev-shm-usage`, `--force-device-scale-factor=1`, `--disable-gpu`,
`--disable-accelerated-2d-canvas`, `--lang=en-GB`, `--allow-insecure-localhost`,
]
.concat(this.isWindows ? [
`--start-maximized`, `--user-data-dir=D:\\AppData\\Puppeteer\\Master`,
] : [
`--no-sandbox`, `--disable-setuid-sandbox`,
`--window-position=0,0`, `--window-size=1366,768`, `--user-data-dir`,
]),
ignoreDefaultArgs: [
// `--enable-automation`, `--remote-debugging-port=0`,
]
}, (this.isWindows ? {
executablePath: "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
} : {
executablePath: "/opt/google/chrome/chrome",
}));
Because i open the browser first and maybe not open the 365 page with bot. I add the workaround on event listener.
this.browser.on('targetcreated', async (target) => {
if (target.type() === 'page') {
const page = await target.page();
await page.evaluateOnNewDocument(() => {
Object.defineProperty(navigator, 'maxTouchPoints', {
get() {
return 1;
},
});
navigator.permissions.query = i => ({then: f => f({state: "prompt", onchange: null})});
});
}
});
"iframe.contentWindow" and "chrome.runtime" are removed from stealth.
test also with the current packages of puppeteer-core, puppeteer-extra and puppeteer-extra-plugin-stealth, it didn't work on linux.
test also with the current packages of puppeteer-core, puppeteer-extra and puppeteer-extra-plugin-stealth, it didn't work on linux.
It works when I do it manually from my chrome browser in windows, can't we tell puppeteer to "join" the copy of my browser that is open and take control from their?
@vladtreny can get X-Net-Sync-Term and make a request to SportsBook.API, but I would like the statistics of live matches, like goal kicks, dangerous attacks, corners, etc ... How do I get this?
test also with the current packages of puppeteer-core, puppeteer-extra and puppeteer-extra-plugin-stealth, it didn't work on linux.
It works when I do it manually from my chrome browser in windows, can't we tell puppeteer to "join" the copy of my browser that is open and take control from their?
There's no problem to open or control 365 in windows now, you don't need "join" and "controal".
My Problem is how to make it work on my linux.
ps: now it works on windows without navigator.maxTouchPoints also.
test also with the current packages of puppeteer-core, puppeteer-extra and puppeteer-extra-plugin-stealth, it didn't work on linux.
It works when I do it manually from my chrome browser in windows, can't we tell puppeteer to "join" the copy of my browser that is open and take control from their?
There's no problem to open or control 365 in windows now, you don't need "join" and "controal".
My Problem is how to make it work on my linux.
ps: now it works on windows without navigator.maxTouchPoints also.
Hello,
I'm curious how "There's no problem to open or control 365 in windows now" is your case, because my program below only displays a white page that never loads on my windows 10 computer, and just a couple of days ago it worked. Thanks for all your input, Louis
const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
const stealth = StealthPlugin();
stealth.enabledEvasions.delete('chrome.runtime');
stealth.enabledEvasions.delete('iframe.contentWindow');
puppeteer.use(stealth);
const second = 1.0;
async function nav() {
const browser = await puppeteer.launch({headless: false, slowMo: 200} );
const page = await browser.newPage();
await page.evaluateOnNewDocument(() => {
Object.defineProperty(navigator, 'maxTouchPoints', {
get() {
return 1;
},
});
navigator.permissions.query = i => ({then: f => f({state: "prompt", onchange: null})});
});
await page.goto('https://www.bet365.com');
await page.waitFor(15000*second);
await browser.close();
}
nav();
As a side note, I also removed "navigator.maxTouchPoints" and it produces the same result. These are my current versions:
C:\Users\louis\node>show_versions.bat
npm show chromium version
3.0.2
npm show puppeteer version
7.0.1
npm show puppeteer-extra version
3.1.16
npm show puppeteer-extra-plugin-stealth version
2.7.4
C:\Users\louis\node>
i found the reason, use yarn but not npm. it solve my problem.
I'm locking this issue now for the following reasons:
stealth
, with the stated purpose to remove subtle differences between scripted & regular browsersThanks!
edit: Further discussion should happen on the community discord
Describe the bug
Code Snippet
Versions
System: OS: Windows 10 10.0.18363 CPU: (8) x64 Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz Memory: 8.31 GB / 15.86 GB Binaries: Node: 12.17.0 - C:\Program Files\nodejs\node.EXE npm: 6.14.10 - ~\AppData\Roaming\npm\npm.CMD