Skip to content

mcolella14/pyppeteer_stealth

Repository files navigation

pyppeteer-stealth

Transplanted from puppeteer-extra-plugin-stealth, Not perfect.

Install

$ pip install pyppeteer_stealth

Usage

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/")
    await browser.close()
asyncio.get_event_loop().run_until_complete(main())

Args

stealth(
  page: Page,
  run_on_insecure_origins: bool = False,
  languages: [str] = ["en-US", "en"],
  vendor: str = "Google Inc."
  user_agent: str = None,
  locale: str = "en-US,en",
  mask_linux: bool = True,
  webgl_vendor: str = "Intel Inc.",
  renderer: str = "Intel Iris OpenGL Engine",
)

Test results

Pyppeteer without stealth

headless headful

Pyppeteer with stealth

headless headful

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 82.1%
  • Python 17.9%