Open JerryChenn07 opened 3 years ago
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:
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.
--no-sandbox
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())
遇到了相同的问题
Under the root user of Linux, if I set --no-sandbox, stealth fails
result:
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.