Skip to main content

🎭 Patchright Python


Patchright Version GitHub Downloads (all assets, all releases)

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.


Sponsors

Hyperbrowser Banner Ad
If you’re looking for a high-performance browser automation platform checkout Hyperbrowser. It’s ideal for AI Agents, large-scale web scraping and automated testing.
Hyperbrowser delivers cloud-based browser infrastructure that scales instantly from a few sessions to thousands, with built-in CAPTCHA solving, stealth fingerprinting, and a global proxy network. It integrates seamlessly with Puppeteer, Playwright, and Selenium, so you can be up and running in minutes, no server or proxy management required.

Key Features:

  • Instant scaling: Launch 1,000+ concurrent browsers
  • Captcha Solving: Handles reCAPTCHA, Cloudflare, AWS, and more
  • Stealth mode: Dynamic, human-like fingerprints for undetectable automation
  • Global proxy network: 170+ countries with rotation and geo-targeting
  • Built-in debugging: Live view and session replay for real-time monitoring
  • 1-line integration: Works with Puppeteer, Playwright, Selenium in Node.js or Python

👉 Learn more at hyperbrowser.ai


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!

# 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
    ...
)

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.


© 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

Metadata

Release files for patchright-fork 1.56.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for patchright-fork 1.56.2
File Actions
patchright_fork-1.56.2-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for patchright_fork-1.56.2-py3-none-win_arm64.whl
patchright_fork-1.56.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for patchright_fork-1.56.2-py3-none-win_amd64.whl
patchright_fork-1.56.2-py3-none-win32.whl Python 3 none Windows x86-32 Details for patchright_fork-1.56.2-py3-none-win32.whl
patchright_fork-1.56.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for patchright_fork-1.56.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
patchright_fork-1.56.2-py3-none-manylinux1_x86_64.whl Python 3 none Linux glibc 2.5+ x86-64 Details for patchright_fork-1.56.2-py3-none-manylinux1_x86_64.whl
patchright_fork-1.56.2-py3-none-macosx_11_0_universal2.whl Python 3 none macOS 11.0+ universal2 (ARM64, x86-64) Details for patchright_fork-1.56.2-py3-none-macosx_11_0_universal2.whl
patchright_fork-1.56.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for patchright_fork-1.56.2-py3-none-macosx_11_0_arm64.whl
patchright_fork-1.56.2-py3-none-macosx_10_13_x86_64.whl Python 3 none macOS 10.13+ x86-64 Details for patchright_fork-1.56.2-py3-none-macosx_10_13_x86_64.whl

Total release size: 315.4 MB

Release files / patchright_fork-1.56.2-py3-none-win_arm64.whl

Download URL patchright_fork-1.56.2-py3-none-win_arm64.whl
Size 31.2 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
ff2c69f178c75ce69ecfb903204608bd35654847f0de7110119134d445cb2354
BLAKE2b-256 checksum
How to use checksums
e46728a6c997c09143e1d3a0fcc6bd7aebb577ca7eba17f9a1f92864f43adfb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2025.

Transparency log

Release files / patchright_fork-1.56.2-py3-none-win_amd64.whl

Download URL patchright_fork-1.56.2-py3-none-win_amd64.whl
Size 35.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
84b54577e9868ed89018b385b10b478f040b90f851376b976547d4483898e615
BLAKE2b-256 checksum
How to use checksums
99164e07f8c29c125e85f76a25798487527d9cdf9c01fb68879527472d2d2239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2025.

Transparency log

Release files / patchright_fork-1.56.2-py3-none-win32.whl

Download URL patchright_fork-1.56.2-py3-none-win32.whl
Size 35.6 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
1b38f1c8c53f2abfb8a83d4dd95f7a5d0946e6fbc7ab455f2281977c16e4eef9
BLAKE2b-256 checksum
How to use checksums
295a9d5d97e4b378ca210c04c09daacc5ecd21d0ced625b2904ee3d4909cb352
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2025.

Transparency log

Release files / patchright_fork-1.56.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL patchright_fork-1.56.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 46.1 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
d4625f3a4a2da07ce8d90550bdaa0095ce7a398ab232cd12b34d9ba5eb86b1c6
BLAKE2b-256 checksum
How to use checksums
2436ecb3a63ba9d9323b78e2511a732392e9db6bca0846aec365e0a2bebab22c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2025.

Transparency log

Release files / patchright_fork-1.56.2-py3-none-manylinux1_x86_64.whl

Download URL patchright_fork-1.56.2-py3-none-manylinux1_x86_64.whl
Size 46.3 MB
Tags Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
8761c798e7d301329495a337ff90897e5a4d0e93bbfcd686b1f40ed900adf766
BLAKE2b-256 checksum
How to use checksums
505c647e0c4741d571f240ecd890c8f4932bc6c42092569891dba728bf299144
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2025.

Transparency log

Release files / patchright_fork-1.56.2-py3-none-macosx_11_0_universal2.whl

Download URL patchright_fork-1.56.2-py3-none-macosx_11_0_universal2.whl
Size 40.6 MB
Tags Python 3 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
16ad19f421535501d6dcb695f95bb3cffab54a1c9839c4039428b92de552e833
BLAKE2b-256 checksum
How to use checksums
bdb37648bc3d2a26ab7aabc359c58d58bb012d9d955190d7d047afb02809a106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2025.

Transparency log

Release files / patchright_fork-1.56.2-py3-none-macosx_11_0_arm64.whl

Download URL patchright_fork-1.56.2-py3-none-macosx_11_0_arm64.whl
Size 39.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
422c278e384fb811929e18ff0b4d72d1ca3b895e06bc4081db47bc33809685b3
BLAKE2b-256 checksum
How to use checksums
7ac432c402d307599665e614d1559554acde53931799cba6bf751a12c5419350
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2025.

Transparency log

Release files / patchright_fork-1.56.2-py3-none-macosx_10_13_x86_64.whl

Download URL patchright_fork-1.56.2-py3-none-macosx_10_13_x86_64.whl
Size 40.6 MB
Tags Python 3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
a97c76c2de283013203d012502be358978d16689bd837e459f5565a39c346b5d
BLAKE2b-256 checksum
How to use checksums
fd40f67e85710b70248ca7d54b8e1a5408124fca1e31a44d02fbaa5043fa349c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2025.

Transparency log

Security for patchright-fork 1.56.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for patchright_fork-1.56.2-py3-none-win_arm64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.56.2 This release

8 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page