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

Uploaded Source

Built Distribution

tf_playwright_stealth-1.2.0-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tf_playwright_stealth-1.2.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.2 Darwin/24.5.0

File hashes

Hashes for tf_playwright_stealth-1.2.0.tar.gz
Algorithm Hash digest
SHA256 7bb8d32d3e60324fbf6b9eeae540b8cd9f3b9e07baeb33b025dbc98ad47658ba
MD5 a9e02580563148ad8d87f1209233598f
BLAKE2b-256 d66b32bb58c65991f91aeaaf7473b650175d9d4af5dd383983d177d49ccba08d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tf_playwright_stealth-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26ee47ee89fa0f43c606fe37c188ea3ccd36f96ea90c01d167b768df457e7886
MD5 82c1248f6a9a842420a138c4868ba65e
BLAKE2b-256 113d2653f4cf49660bb44eeac8270617cc4c0287d61716f249f55053f0af0724

See more details on using hashes here.

Supported by

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