Patchright Python for Chromium automation
Undetected Python version of the Playwright testing and automation library.
At a glance
- What is it?
- Patchright Python offers a Playwright-style API backed by a patched Chromium driver. It fits Python automation that needs Chromium, but it does not support Firefox or WebKit and requires Python 3.11 or newer.
- Who is it for?
- Adopt Patchright when an existing Python workflow already uses Playwright conventions, targets only Chromium, and needs a patched driver. Do not adopt it as a browser-complete Playwright replacement or use its “undetected” label as a guarantee.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 3 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Patchright's Chromium-specific automation boundary
Patchright addresses browser automation in Python workflows that follow the Playwright model but need a patched Chromium driver. Its intended users are Python developers automating Chromium pages, running browser-based tests, or collecting data through an interactive browser session. The API familiarities reduce migration friction: the README calls Patchright a drop-in replacement for Playwright, and the package exposes `patchright.sync_api` and `patchright.async_api` entry points modeled after Playwright.
That claim has an important boundary. Patchright patches Chromium-based browsers only. The README explicitly says that Firefox and WebKit are not supported. It is therefore not a like-for-like replacement for projects that select among all three Playwright browser engines. Even within Chromium, adopting Patchright is not simply installing an alternative import path. The repository points users to a separate Node.js package for Node.js and to a separate Patchright Driver repository, indicating a division between the Python package and its patched driver.
The project describes itself as “undetected,” but the README does not define a supported detection test, list protected sites, promise a particular detection rate, or explain how detection resistance changes as browser sites evolve. That wording should be treated as a project description, not as a measurable guarantee. Users need site-specific validation before placing production automation behind it.
Patchright's API and patched-driver data flow
A Python script starts the Patchright runtime through `sync_playwright()` or `async_api.async_playwright()`. It selects the Chromium implementation, launches a browser, creates a page, navigates it to a URL, and can capture a screenshot. This is an automation flow driven by the caller. The script decides which actions to invoke and remains responsible for closing both the browser and the Playwright-style context manager.
The distinguishing component is below the familiar API: the repository identifies the driver as patched, while the `pyproject.toml` describes the distribution as an undetected Python version of Playwright. Based on the repository layout, the PyPI package is the Python-facing layer and the linked Patchright Driver repository is the browser-driver layer. The README does not document the patch implementation, which browser binaries it modifies, or which automation signals each release addresses. It is consequently impossible to assess those details from this repository alone.
The synchronous example follows a direct data path. `sync_playwright()` yields a runtime object, `p.chromium.launch()` starts Chromium, and `browser.new_page()` creates a page. `page.goto('http://playwright.dev')` requests that page, after which `page.screenshot(path=f'example-{p.chromium.name}.png')` writes a screenshot to the local filesystem. Patchright preserves this control flow while substituting its patched Chromium-focused machinery. The asynchronous API is also documented, although the README example is cut off before completion.
Installing Patchright and capturing a first page
The documented PyPI installation has two commands. First, install the Python package. The second command installs the Chromium driver required by that package. Run both in the Python environment where the automation will be used.
pip install patchrightThis command installs the `patchright` distribution from PyPI. Its metadata requires Python 3.11 or newer.
patchright install chromiumThis command installs Chromium support for Patchright. A successful environment should provide the `patchright` command and the browser files it needs.
The following real use opens a page and saves a screenshot. It uses the synchronous API from the README and requires no unlisted flags or environment variables:
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()Save the script and run it with Python. Based on the example, a successful visit should create `example-chromium.png` in the working directory. The code also closes Chromium explicitly. Leaving that call out would rely on process cleanup rather than the documented cleanup path. The URL uses HTTP because that is the exact address in the README; no claim is made here about redirect behavior or page content.
Playwright migration limits in Patchright Python
Patchright is most credible where a team already organizes automation around Playwright's Python API. Changing the import from Playwright to Patchright may preserve familiar calls for Chromium workflows, but “drop-in replacement” should not be interpreted as support for every Playwright feature or browser engine.
The README does not publish a compatibility matrix. It does not confirm whether every Playwright API, fixture, browser option, protocol feature, or upstream release has an exact Patchright equivalent. It also does not document a migration command, compatibility range, or procedure for resolving differences. Users who depend on Firefox, WebKit, or cross-browser testing should not select it on the basis of the import similarity alone.
The project also provides no documented fallback, retry policy, or guarantee that navigation will succeed against a site with its own bot controls. Browser patching, IP reputation, session history, cookies, request patterns, and site policy can all affect whether an automation is accepted, but the README does not claim that Patchright controls or guarantees any particular combination of those factors. The project is a browser automation layer, not a documented access-rights service.
For an existing suite, the safer interpretation is selective Chromium evaluation. Keep non-Chromium coverage on a Playwright implementation, and compare Patchright only against the flows that require its patched driver.
Patchright release cadence and package upkeep
The repository is not archived, and its last push was on 2026-09-20. That supports calling it recently changed, but it does not prove that every browser site or automation use case will receive a fix immediately. The repository also records releases v1.60.0 on 2026-06-03, v1.61.0 on 2026-07-05, and v1.62.0 on 2026-08-17.
Those release dates suggest periodic package updates during this period. They do not establish a fixed support window or a guaranteed response time when Chromium, a target site, or its detection logic changes. The README does not publish a long-term-support policy, upgrade guide, migration policy, or compatibility promise. Upgrade cost therefore remains tied to validating existing automation after a package change.
The package metadata requires Python 3.11 or newer. Teams on older Python versions face an upgrade requirement before installation. Development dependencies listed in `pyproject.toml` include `pytest`, `pytest-asyncio`, `pillow`, `pixelmatch`, and several networking or testing packages, but those entries are for the development group. The README does not ask ordinary users to install that group for the basic example.
Patchright is distributed under `Apache-2.0`. The repository provides a `LICENSE` file and an Apache 2.0 badge. This identifies the stated license, while actual compliance for a particular distribution or deployment depends on the license text and applicable obligations.
Patchright versus standard Playwright browser selection
Standard Playwright is the relevant alternative because Patchright explicitly presents itself around Playwright's testing and automation model. The practical difference is the browser layer and intended compatibility boundary, not the basic page sequence.
With Playwright, a Python project can select among Chromium, Firefox, and WebKit through its browser APIs. Patchright's README limits support to Chromium and identifies its driver as patched. A Playwright project that needs cross-browser coverage therefore has a broader engine choice. A project that only targets Chromium and specifically requires Patchright's patched driver has a reason to evaluate Patchright instead.
Neither Playwright's documentation nor Patchright's README supplies a benchmark comparing detection rates, runtime speed, memory use, or compatibility with a particular target site. As a result, there is no documented basis for claiming that one option is faster or more reliable in general. The decision must turn on browser scope, existing Playwright conventions, and whether the Chromium-specific patch is a stated requirement.
Patchright also requires Python 3.11 or newer. Teams cannot assume that an existing Playwright environment on an older interpreter can install it without changes. For Node.js users, this repository directs them to a separate Patchright Node.js package rather than suggesting that this Python distribution handles Node.js.
Editorial conclusion
Adopt Patchright when an existing Python workflow already uses Playwright conventions, targets only Chromium, and needs a patched driver. Do not adopt it as a browser-complete Playwright replacement or use its “undetected” label as a guarantee. Verify Python 3.11 compatibility, your required Chromium workflows, proxy behavior, and the boundary between the Python package and the separately maintained Patchright driver before migration.
Frequently asked questions
How do I install Patchright Python and Chromium?
Install `patchright` from PyPI, then run `patchright install chromium`. The package metadata requires Python 3.11 or newer.
Does Patchright support Firefox and WebKit?
No. The README explicitly says that Patchright patches Chromium-based browsers only and does not support Firefox or WebKit.
Can Patchright Python be used as a Playwright replacement?
The README calls it a drop-in replacement for Playwright, but the documented browser support is limited to Chromium. The repository does not provide a complete Playwright compatibility matrix.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/kaliiiiiiiiii-vinyzu-patchright-python)