patchright-python is a free, open source data extraction & web scraping project written in Python and released under Apache-2.0. It has 1,586 GitHub stars, 120 forks and 2 open issues, and was last pushed 14 days ago. On this registry it ranks #94 of 149 tracked projects in Data Extraction & Web Scraping, with 5 head-to-head comparisons available. It gained 47 stars over the last 30 tracked days.

What is patchright-python?

Patchright Python is a patched, undetected Python build of the Playwright testing and automation framework, published on PyPI as patchright, and it is for Python developers who need browser automation to survive bot detection instead of being turned away by it.

What it is

Patchright Python is the Python package of Patchright, described in its README as a patched and undetected version of the Playwright Testing and Automation Framework. The README states that it can be used as a drop-in replacement for Playwright, which places it in the same ecosystem as the stock Playwright Python bindings: existing Playwright automation code is the intended entry point, and the difference sits in the patch set underneath rather than in a new API to learn.

The problem it solves is detection. Playwright is a testing and automation framework, and sites that deploy bot detection treat its automation surface as a signal and block it. Patchright targets that gap directly, and its own topic list names the ground it covers: browser, chrome, chromium, chromedriver, cloudflare, stealth, bot, and botting. The specific thing it replaces is the unpatched Playwright runtime a Python team would otherwise install. It is not alone in that effort: the README points to the patchright-nodejs package for NodeJS and to the main Patchright driver repository that the Python package is built around.

Key capabilities

  • Drop-in replacement for Playwright, so existing Playwright Python automation runs against it without a rewrite.
  • Distributed as the patchright package on PyPI, at pypi.org/p/patchright.
  • Patch set comes from the shared Patchright driver repository, which this Python package wraps.
  • Drives Chrome, Chromium, and chromedriver browser surfaces rather than a headless-only substitute.
  • Aimed at stealth work against Cloudflare-style bot detection, per the project's topic list.
  • Has a NodeJS counterpart named patchright-nodejs for teams that need the same behaviour outside Python.
  • Licensed under Apache-2.0, so the patch set can be inspected, forked, and vendored.

Who uses it and how

  • Python teams already running Playwright that hit bot detection: change the dependency to patchright and keep the scripts.
  • Data extraction and scraping pipelines where Cloudflare-style protection blocks stock Playwright.
  • Operators running browsers behind rotating or sticky residential proxies; the README's sponsors (NodeMaven, Swiftproxy, RapidProxy) pitch proxy rotation, geo-targeting, and IP filtering directly at Patchright users.
  • Multi-accounting and botting setups, matching the bot, bots, and botting topics on the repository.
  • NodeJS teams use patchright-nodejs, while this repository serves the Python side.

Getting started

Install the patchright package from PyPI at pypi.org/p/patchright; the README frames it as a drop-in replacement for Playwright, so existing Playwright setup and scripts carry over. The NodeJS equivalent lives in the separate patchright-nodejs package.

How it compares

No list of paid products it replaces is given, so the useful comparison is with the tools the README names. Against stock Playwright the axis is detection rather than features: same framework lineage, drop-in replacement, with patches that Playwright itself does not ship. Its NodeJS sibling patchright-nodejs covers the JavaScript side, and both derive from the main Patchright driver repository.

When to use it — and when not to

There is no server to operate here: it is a library, so no database, storage, or SMTP is involved. What a user supplies is a Python environment plus the browser binaries it drives (Chromium, Chrome, chromedriver), and any proxy infrastructure is their own, which is where the sponsored proxy services in the README come in. Do not pick it if terms-of-service compliance or long-term API stability measured against upstream Playwright is the priority, or if a review process needs more than a sponsor-heavy README: the excerpt is largely proxy advertising with no install or usage walkthrough, so users lean on upstream Playwright documentation for the actual API.

project readme (upstream, from github) — read inline

🎭 Patchright Python


Patchright Version PyPI Downloads

Patchright is a patched and undetected version of the Playwright Testing and Automation Framework.
It can be used as a drop-in replacement for Playwright.

[!NOTE]
This repository serves the Patchright-Python Package. To use Patchright with NodeJS, check out the NodeJS Package. Also check out the main Patchright Driver Repository


Sponsors

Want to Sponsor this Project? Contact @vinyzu on Discord!

NodeMaven Banner

##### NodeMaven: Your efficient proxy provider for Web Scraping and Automation with High Quality IPs.


Why NodeMaven?

🎯 ZIP targeting
✅ 99.9% Uptime
🔍 IP Filtering: Proxies are guaranteed to have fraud score 🔰 No KYC required
🎉 Unique free tools: Proxy Bandwidth Checker, Meta Tag Checker, IP Lookup and others!

Special codes for Patchright users:
🔥 PATCHRIGHT35 - 35% off to Mobile and Residential Proxies
🔥 PATCHRIGHT40 - 40% off to ISP (Static) Proxies

Choose quality and stability with NodeMaven.


swiftproxy banner

Swiftproxy: High-Performance Residential Proxies for Scalable Data Collection

Built for developers who need reliable, anti-detection proxy infrastructure. Swiftproxy delivers stable connections, high success rates, and flexible control for large-scale scraping and automation.

  • 🌍 195+ locations with ethically sourced residential IPs
  • 🔄 Rotating & sticky sessions with precise geo-targeting
  • ⚡ Optimized for anti-ban & high success rate
  • 🔌 HTTP / HTTPS / SOCKS5 support
  • 🧪 Free 500MB trial for testing
  • 💸 Special discount code for Patchright users: PROXY90 - 10%

Best for: Web scraping, automation, multi-accounting, and large-scale data extraction


rapidproxy banner

RapidProxy provides a stable and high-performance proxy network built for large-scale data operations.

RapidProxy delivers:

  • 🌍 90M+ Residential IPs (200+ locations)
  • 🔄 Rotating Residential Proxies — from $0.65/GB (non-expiring traffic)
  • 🧩 Static Residential IPs — $5/IP (30 days, unlimited traffic)
  • 🎯 Precise geo-targeting
  • ⚡ Free Trial Available — test proxy performance risk-free
  • Built for scraping, automation, and high-performance data workflows.
  • 🔥 Special Offer: Use code RAPID10 to get 10% off

Start fast. Scale globally. Stay stable with RapidProxy.


Scrappey

Sponsored by Scrappey

Getting the browser past detection is one problem. Keeping proxies rotating, fingerprints current and sessions alive across a few million requests is a different one. Scrappey takes the second problem: one endpoint, solved pages back.

  • Clearcote — our own patched Chromium, maintained in-house, not a stock build
  • Several engines behind one endpoint — blocked on one stack, routed to another
  • Click, type, wait and scroll over the API — a real session, not a fetch proxy
  • Residential and datacenter proxies included, or bring your own
  • Per request, no monthly minimum
curl -X POST "https://publisher.scrappey.com/api/v1?key=YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cmd": "request.get", "url": "https://example.com"}'

Get 10% off with code PATCHRIGHT

Documentation · Discord · Get an API key


Install it from PyPI

# Install Patchright with Pip from PyPI
pip install patchright
# Install Chromium-Driver for Patchright
patchright install chromium

Usage

Just change the import and use it like playwright. Patchright is a drop-in-replacement for Playwright!

[!IMPORTANT]
Patchright only patches CHROMIUM based browsers. Firefox and Webkit are not supported.

# patchright here!
from patchright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page()
    page.goto('http://playwright.dev')
    page.screenshot(path=f'example-{p.chromium.name}.png')
    browser.close()
import asyncio
# patchright here!
from patchright.async_api import async_playwright

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch()
        page = await browser.new_page()
        await page.goto('http://playwright.dev')
        await page.screenshot(path=f'example-{p.chromium.name}.png')
        await browser.close()

asyncio.run(main())

Best Practice - use Chrome without Fingerprint Injection

To be completely undetected, use the following configuration:

playwright.chromium.launch_persistent_context(
    user_data_dir="...",
    channel="chrome",
    headless=False,
    no_viewport=True,
    # do NOT add custom browser headers or user_agent
    ...
)

[!NOTE]
We recommend using Google Chrome instead of Chromium. You can install it via patchright install chrome (or via any other installation method) and use it with channel="chrome".


Patches

Runtime.enable Leak

This is the biggest Patch Patchright uses. To avoid detection by this leak, patchright avoids using Runtime.enable by executing Javascript in (isolated) ExecutionContexts.

Console.enable Leak

Patchright patches this leak by disabling the Console API all together. This means, console functionality will not work in Patchright. If you really need the console, you might be better off using Javascript loggers, although they also can be easily detected.

Command Flags Leaks

Patchright tweaks the Playwright Default Args to avoid detection by Command Flag Leaks. This (most importantly) affects:

  • --disable-blink-features=AutomationControlled (added) to avoid navigator.webdriver detection.
  • --enable-automation (removed) to avoid navigator.webdriver detection.
  • --disable-popup-blocking (removed) to avoid popup crashing.
  • --disable-component-update (removed) to avoid detection as a Stealth Driver.
  • --disable-default-apps (removed) to enable default apps.
  • --disable-extensions (removed) to enable extensions

General Leaks

Patchright patches some general leaks in the Playwright codebase. This mainly includes poor setups and obvious detection points.

Closed Shadow Roots

Patchright is able to interact with elements in Closed Shadow Roots. Just use normal locators and Patchright will do the rest.
Patchright is now also able to use XPaths in Closed Shadow Roots.


Stealth

With the right setup, Patchright currently is considered undetectable. Patchright passes:


Documentation and API Reference

See the original Playwright Documentation and API Reference

Extended Patchright API

evaluate Method (Frame.evaluate, Page.evaluate, Locator.evaluate, Worker.evaluate, JSHandle.evaluate)
  • Added isolated_context to choose Execution Context (Main/Isolated). Bool (optional, Defaults to True)
object.evaluate(
    expression: str,
    arg: typing.Optional[typing.Any] = None,
    ...,
+   isolated_context: typing.Optional[bool] = True
)
evaluate_handle Method (Frame.evaluate_handle, Page.evaluate_handle, Locator.evaluate_handle, Worker.evaluate_handle, JSHandle.evaluate)
  • Added isolated_context to choose Execution Context (Main/Isolated). Bool (optional, Defaults to True)
object.evaluate_handle(
    expression: str,
    arg: typing.Optional[typing.Any] = None,
    ...,
+   isolated_context: typing.Optional[bool] = True
)
evaluate_all Method (Locator.evaluate_all)
  • Added isolated_context to choose Execution Context (Main/Isolated). Bool (optional, Defaults to True)
Locator.evaluate_all(
    expression: str,
    arg: typing.Optional[typing.Any] = None,
    ...,
+   isolated_context: typing.Optional[bool] = True
)

Bugs

The bugs are documented in the Patchright Driver Repository.

TODO

The TODO is documented in the Patchright Driver Repository.

Development

Deployment of new Patchright versions are automatic, but bugs due to Playwright codebase changes may occur. Fixes for these bugs might take a few days to be released.


Support our work

If you choose to support our work, please contact @vinyzu or @steve_abcdef on Discord.


Copyright and License

© Vinyzu

Patchright is licensed Apache 2.0


Disclaimer

This repository is provided for educational purposes only.
No warranties are provided regarding accuracy, completeness, or suitability for any purpose. Use at your own risk—the authors and maintainers assume no liability for any damages, legal issues, or warranty breaches resulting from use, modification, or distribution of this code.
Any misuse or legal violations are the sole responsibility of the user.


Authors

Active Maintainer: Vinyzu
Co-Maintainer: Kaliiiiiiiiii

Frequently asked questions

Is patchright-python free to use?

patchright-python is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does patchright-python do?

Undetected Python version of the Playwright testing and automation library.

What is patchright-python written in?

patchright-python is primarily written in Python. Its source is publicly available at https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python, and it has 1,586 GitHub stars.