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.3.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

tf_playwright_stealth-1.0.3-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tf_playwright_stealth-1.0.3.tar.gz
  • Upload date:
  • Size: 24.1 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.3.tar.gz
Algorithm Hash digest
SHA256 94353842c6517fba19da2277c5b68272f86eb6bfb056f36d66b5b8497fc96133
MD5 b7ffbd5367c6ef467bd206e6e94df7aa
BLAKE2b-256 e271f8871c2c468011f5881094c45687307756f4299bbb7bf0ed1236977c093b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tf_playwright_stealth-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2d341f485eb5fc61fc7755f7f7f803e06d133ee263e0dfa632d16f9c99008f4d
MD5 80ce5858b889ce0f82d739355a1c1666
BLAKE2b-256 65720a21181b534f2d1be535558375ec9122a7c80df1aeea4f8fd85947955eb4

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