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

Under the root user of Linux, if I set --no-sandbox, stealth fails #25

Open
JerryChenn07 opened this issue Apr 20, 2021 · 1 comment
Open

Comments

@JerryChenn07
Copy link

Under the root user of Linux, if I set --no-sandbox, stealth fails

import asyncio

from pyppeteer import launch
from pyppeteer_stealth import stealth



async def main():
    opt = {'headless': True,'args': ['--no-sandbox']}
    browser = await launch(opt)
    page = await browser.newPage()

    await stealth(page)  # <-- Here

    await page.goto("https://bot.sannysoft.com/")
    print(await page.content())
    await browser.close()


asyncio.run(main())

result:
image


But if I modify the source code of pyppeteer, write --no-sandbox directly in the DEFAULT_ARGS of the source code, it will take effect.

import asyncio

from pyppeteer import launch
from pyppeteer_stealth import stealth



async def main():
    browser = await launch(headless=True)
    page = await browser.newPage()

    await stealth(page)  # <-- Here

    await page.goto("https://bot.sannysoft.com/")
    print(await page.content())
    await browser.close()


asyncio.run(main())

image

@songge8
Copy link

songge8 commented Jan 23, 2022

遇到了相同的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants