Skip to main content

Makes playwright stealthy like a ninja!

Project description

🥷🏻 tf-playwright-stealth PyPI version AgentQL Join Discord

Transplanted from puppeteer-extra-plugin-stealth.

This is a package that makes playwright stealthy like a ninja by spoofing browser features in order to reduce the chance of detection.

Install

pip install tf-playwright-stealth

Usage

sync

from playwright.sync_api import sync_playwright
from playwright_stealth import stealth_sync

with sync_playwright() as p:
    browser = p.chromium.launch(
            headless=True,
        )
    page = browser.new_page()
    stealth_sync(page)
    page.goto("https://bot.sannysoft.com/")
    page.screenshot(path=f"example_with_stealth.png", full_page=True)
    browser.close()

async

from playwright.async_api import async_playwright
from playwright_stealth import stealth_async

with async_playwright() as p:
    browser = await p.chromium.launch(
            headless=True,
        )
    page = await browser.new_page()
    await stealth_async(page)
    await page.goto("https://bot.sannysoft.com/")
    await page.screenshot(path=f"example_with_stealth_async.png", full_page=True)
    await browser.close()

Results

From bot.sannysoft.com

Headless Headful
Headless Headful

Project details


Download files

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

Source Distribution

tf_playwright_stealth-1.0.0.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

tf_playwright_stealth-1.0.0-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file tf_playwright_stealth-1.0.0.tar.gz.

File metadata

  • Download URL: tf_playwright_stealth-1.0.0.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0

File hashes

Hashes for tf_playwright_stealth-1.0.0.tar.gz
Algorithm Hash digest
SHA256 abc71cf71148c6a68a7de57e5405740518765b44f5ab90c61e70ee3b19044cb2
MD5 0e7078b3346a83032be389867563251b
BLAKE2b-256 72c1d47ed82938f5339bf520e4789d3aa753a54fba8d76085718de52d4d20b12

See more details on using hashes here.

File details

Details for the file tf_playwright_stealth-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tf_playwright_stealth-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c92646b52f3a457ea76921bd985b3762b1aee9f33948daed8a4a3da7a897837
MD5 d48077a523042e065c02e1fdbc50c64d
BLAKE2b-256 23551246884d1a8f88c5872aff3e6389d7f31c501a57997197c1cc29eb7c1e7d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page