{"id":4803,"library":"tf-playwright-stealth","title":"tf-playwright-stealth","description":"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.","status":"active","version":"1.2.0","language":"en","source_language":"en","source_url":"https://github.com/tinyfish-io/tf-playwright-stealth","tags":["playwright","stealth","browser automation","web scraping","anti-bot"],"install":[{"cmd":"pip install tf-playwright-stealth","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core browser automation library, required for functionality.","package":"playwright","optional":false}],"imports":[{"symbol":"stealth_sync","correct":"from playwright_stealth import stealth_sync"},{"symbol":"stealth_async","correct":"from playwright_stealth import stealth_async"},{"note":"The 'Stealth' class (with a capital 'S') belongs to the separate 'playwright-stealth' package, not 'tf-playwright-stealth'. This package exports 'stealth_sync' and 'stealth_async' (lowercase 's') functions.","wrong":"from playwright_stealth import Stealth","symbol":"Stealth"}],"quickstart":{"code":"from playwright.sync_api import sync_playwright\nfrom playwright_stealth import stealth_sync\n\nwith sync_playwright() as p:\n    browser = p.chromium.launch(headless=True)\n    page = browser.new_page()\n    stealth_sync(page)\n    page.goto(\"https://bot.sannysoft.com/\")\n    print(f\"Page title: {page.title()}\")\n    page.screenshot(path=\"example_with_stealth.png\", full_page=True)\n    browser.close()","lang":"python","description":"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."},"warnings":[{"fix":"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`.","message":"There are two similarly named, but distinct, Python packages: `tf-playwright-stealth` (this library) and `playwright-stealth`. They have different APIs. `tf-playwright-stealth` provides `stealth_sync` and `stealth_async` functions, while `playwright-stealth` offers a `Stealth` class. Attempting to import `Stealth` from `playwright_stealth` when `tf-playwright-stealth` is installed will result in an `ImportError`. Ensure you use the correct imports for the installed package.","severity":"gotcha","affected_versions":"All versions"},{"fix":"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.","message":"Stealth plugins like `tf-playwright-stealth` primarily address browser fingerprinting (e.g., `navigator.webdriver`, plugins, user-agent consistency). They do not inherently prevent detection based on IP reputation, TLS fingerprinting (JA3/JA4), behavioral analysis, or advanced JavaScript challenges employed by sophisticated anti-bot systems (like Cloudflare Turnstile, DataDome, Kasada).","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to the latest version of `tf-playwright-stealth` (`pip install --upgrade tf-playwright-stealth`) and ensure a clean Python environment.","message":"Older versions (prior to 1.x, or specific bugfix releases) of `playwright_stealth` (the internal module name) may have suffered from a missing `__init__.py` file, leading to `ImportError` issues. While likely resolved in current versions, users experiencing import problems should verify the package structure or update to the latest release.","severity":"gotcha","affected_versions":"<1.0.0 (and potentially early 1.x versions)"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}