tf-playwright-stealth is a Python package designed to make Playwright instances stealthy by spoofing browser features, thereby reducing the chance of detection by anti-bot systems. The current version is 1.2.0, and it has seen multiple releases since its first publication in March 2024, indicating active maintenance.
pip install tf-playwright-stealthVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to apply stealth features to a synchronous Playwright page. It launches a headless Chromium browser, applies the `stealth_sync` function to the page, and then navigates to a bot detection test site (sannysoft.com) to verify its effectiveness.
Use `from playwright_stealth import stealth_sync` or `from playwright_stealth import stealth_async` instead of `from playwright_stealth import Stealth` when using `tf-playwright-stealth`.
For more robust evasion against advanced detection, consider combining stealth techniques with residential proxies, careful pacing, human-like interaction simulation, and potentially specialized managed browser infrastructure or CAPTCHA-solving services.
Upgrade to the latest version of `tf-playwright-stealth` (`pip install --upgrade tf-playwright-stealth`) and ensure a clean Python environment.
Use underscores in the import statement: `import tf_playwright_stealth` or `from tf_playwright_stealth import stealth_sync`
Call the appropriate stealth function after creating the `Page` object: `from tf_playwright_stealth import stealth_sync; stealth_sync(page)`
Ensure that `stealth_sync` is used with a `playwright.sync_api.Page` object and `stealth_async` with a `playwright.async_api.Page` object.
Verify the package name is spelled correctly as `tf-playwright-stealth`, ensure an active internet connection, and try `pip install tf-playwright-stealth`.