Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] puppeteer-extra-plugin-stealth can't passby cloudflare verify #908

Open
spencer17x opened this issue Aug 16, 2024 · 4 comments
Open
Labels
issue: bug report A bug has been reported needs triage

Comments

@spencer17x
Copy link

Describe the bug

Code Snippet

Code

import puppeteer from 'puppeteer-extra';
import stealthPlugin from 'puppeteer-extra-plugin-stealth';

const tokenAddress = '0x812ba41e071c7b7fa4ebcfb62df5f45f6fa853ee';
const fullUrl = `https://dexscreener.com/ethereum/${tokenAddress}`;
puppeteer.use(stealthPlugin());

const browser = await puppeteer.launch({
  headless: false,
  devtools: true,
});
const page = await browser.newPage();

await page.goto(fullUrl);

error:
image

Versions

System:
OS: macOS 14.6.1
CPU: (8) arm64 Apple M1
Memory: 394.52 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
pnpm: 7.14.0 - ~/.nvm/versions/node/v16.17.0/bin/pnpm

package.json

{
    "puppeteer": "^23.1.0",
    "puppeteer-extra": "^3.3.6",
    "puppeteer-extra-plugin-stealth": "^2.11.2",
}
@spencer17x spencer17x added issue: bug report A bug has been reported needs triage labels Aug 16, 2024
@nachat-ayoub
Copy link

still no solution ?

@vladtreny
Copy link

I tried your example and bypassed it this way.
Depends on your OS, set correct Chrome binary

            const tokenAddress = '0x812ba41e071c7b7fa4ebcfb62df5f45f6fa853ee'
            const fullUrl = `https://dexscreener.com/ethereum/${tokenAddress}`
            const stealth = StealthPlugin()

            stealth.enabledEvasions.delete('iframe.contentWindow')
            stealth.enabledEvasions.delete('media.codecs')
            stealth.enabledEvasions.delete('user-agent-override')
            puppeteer.use(stealth)

            const browser = await puppeteer.launch({
                headless: false,
                executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', // On Mac
                // If you use Windows, set here
                //   executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
                // For linux
                //   executablePath: '/usr/bin/google-chrome',
                // @ts-ignore
                targetFilter: (target) => !!target.url()
            })
            const page = await browser.newPage()

            await page.goto(fullUrl)

@xyunsh
Copy link

xyunsh commented Oct 22, 2024

any solution?

@spencer17x
Copy link
Author

any solution?

use puppeteer-real-browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug report A bug has been reported needs triage
Projects
None yet
Development

No branches or pull requests

4 participants