Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

pyppeteer stealth

Project description

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,
  language: str = "en-US,en",
  platform: str = "Win32",
  webgl_vendor: str = "Intel Inc.",
  renderer: str = "Intel Iris OpenGL Engine",
)

Test results

Pyppeteer without stealth

Pyppeteer with stealth

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyppeteer-stealth, version 2.6.0
Filename, size File type Python version Upload date Hashes
Filename, size pyppeteer_stealth-2.6.0.tar.gz (17.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page