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

Uploaded Source

Built Distribution

tf_playwright_stealth-1.1.0-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tf_playwright_stealth-1.1.0.tar.gz
  • Upload date:
  • Size: 24.4 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.1.0.tar.gz
Algorithm Hash digest
SHA256 bfe75856c46e50fb3c02c19b5cb490b02bcef125665c53f5ceaa743298b917db
MD5 5bfcdd6209c87986970b0311336b3e17
BLAKE2b-256 20309ab3142b2de98c7a34e5b64091e7ae9042e4ef24d6e587e1c393c27048a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tf_playwright_stealth-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbc6423ad9d87002bd6b42ddb69d0439f02a4ac4990db5d8195b7c31b912f1c5
MD5 b5798796013af03d37e90d09f092d6bd
BLAKE2b-256 5872b8ba12fbe20866ad6b0637293afdb546724505074595a90abb3096ac97b4

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