patchright
Undetected Python version of the Playwright testing and automation library.
What it is and what it does
Patchright is a modified version of Playwright that patches known detection vectors used by anti-bot systems. It disables or modifies default command-line flags, avoids Runtime.enable and Console.enable leaks, and can interact with closed Shadow DOM elements—all designed to make automated browser sessions appear more like legitimate user activity. The package maintains Playwright's sync and async APIs, so existing code can often run unchanged by simply swapping the import statement.
The package is actively maintained with recent releases and passes several major anti-bot systems. It requires Python 3.10 or later and depends on pyee and greenlet. Browser drivers must be installed separately, and the documentation emphasizes using Google Chrome with specific launch configurations for best stealth results.
Use it for:
- Web scraping sites protected by major bot-detection systems
- Automated testing of web applications that check for headless browser signatures
- Account automation workflows where detection avoidance is critical
- Extracting data from sites that actively block automated access
- Interaction with closed Shadow DOM elements without modifying page structure
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Patchright is an undetected fork of Playwright that automates Chromium-based browsers while evading bot-detection systems. It works as a drop-in replacement for Playwright's sync and async APIs.
Yes, if you need to automate Chromium against bot-detection systems and accept the trade-offs. Patchright is actively maintained with no known vulnerabilities. However, install it only if standard Playwright fails due to detection—anti-detection techniques are inherently fragile and may break as detection systems evolve. Verify that your use case complies with the target site's terms of service.
Install
patchright on PyPI
pip
pip install patchrightuv
uv add patchrightpoetry
poetry add patchrightInstalling patchright
Before you install
Medium friction: precompiled wheels for multiple platforms (macOS, Linux, Windows, ARM) reduce build complexity, but requires a separate driver installation step and depends on pyee and greenlet for event handling and async support.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install patchright
patchright install chromium
from patchright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
page.goto('http://example.com')
browser.close()
Requires Python 3.10+. Chromium driver must be installed separately via `patchright install chromium`. Only supports Chromium-based browsers; Firefox and WebKit are not supported.
Verify before relying
- Whether anti-detection patches remain effective as bot-detection systems evolve
- Performance overhead compared to standard Playwright due to stealth modifications
- Compatibility guarantees if Playwright's API changes significantly in future releases
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — pyee, greenlet |
| Maintenance | actively maintained — 40 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,178,710/month — #2,367 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: patchright-1.61.2-py3-none-macosx_10_13_x86_64.whl; patchright-1.61.2-py3-none-macosx_11_0_arm64.whl; patchright-1.61.2-py3-none-macosx_11_0_universal2.whl; patchright-1.61.2-py3-none-manylinux1_x86_64.whl; patchright-1.61.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; patchright-1.61.2-py3-none-win32.whl; patchright-1.61.2-py3-none-win_amd64.whl; patchright-1.61.2-py3-none-win_arm64.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
rebrowser-playwrightA patched version of Playwright that automates…
permissive · top 15,000 on PyPI
playwrightAutomate Chromium, Firefox, and WebKit browsers…
permissive · top 1,000 on PyPI
tf-playwright-stealthPatches Playwright to evade bot-detection…
permissive · top 15,000 on PyPI
cloakbrowserLaunches a stealth Chromium browser that evades…
permissive · top 15,000 on PyPI
pytest-playwrightA pytest plugin that integrates Playwright…
permissive · top 5,000 on PyPI
playwright-stealthApplies evasion techniques to Playwright…
permissive · top 5,000 on PyPI
pytest-playwright-asyncioA pytest plugin that integrates Playwright…
permissive · top 15,000 on PyPI
recognizerSolves reCAPTCHA challenges using AI-based…
permissive · top 15,000 on PyPI
axe-playwright-pythonRuns automated accessibility audits on web…
unclear · top 15,000 on PyPI
robotframework-browserBrowser automation library for Robot Framework…
permissive · top 5,000 on PyPI