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.

[!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


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 (Frame.evaluate_all)

  • Added isolated_context to choose Execution Context (Main/Isolated). Bool (optional, Defaults to True)
Frame.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

Metadata

Release files for re-patchright 1.52.10

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 re-patchright 1.52.10
File
re_patchright-1.52.10-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details
re_patchright-1.52.10-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
re_patchright-1.52.10-py3-none-win32.whl Python 3 none Windows x86-32 Details
re_patchright-1.52.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
re_patchright-1.52.10-py3-none-manylinux1_x86_64.whl Python 3 none Linux glibc 2.5+ x86-64 Details
re_patchright-1.52.10-py3-none-macosx_11_0_universal2.whl Python 3 none macOS 11.0+ universal2 (ARM64, x86-64) Details
re_patchright-1.52.10-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
re_patchright-1.52.10-py3-none-macosx_10_13_x86_64.whl Python 3 none macOS 10.13+ x86-64 Details

Total release size: 307.1 MB

Release files / re_patchright-1.52.10-py3-none-win_arm64.whl

Download URL re_patchright-1.52.10-py3-none-win_arm64.whl
Size 30.7 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
2f47b67a0f31b4e09753f2e94e0075342aaba11f1e2697c1ca13b45eadb2ec58
BLAKE2b-256 checksum
How to use checksums
e754ccd9fb2cfc6cf2f90a39a07ec101e4e0ec552de8ca86959e066f5a5fb43a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 7, 2025.

Transparency log

Release files / re_patchright-1.52.10-py3-none-win_amd64.whl

Download URL re_patchright-1.52.10-py3-none-win_amd64.whl
Size 34.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
aa9cb2e3fbc392a8293b6044d79a576022cf110fb2f7663480fbcc422563c74d
BLAKE2b-256 checksum
How to use checksums
23c96c1ab0ec255ada64a58d40030acdc41f27c82d201fe3067ba895e4020343
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 7, 2025.

Transparency log

Release files / re_patchright-1.52.10-py3-none-win32.whl

Download URL re_patchright-1.52.10-py3-none-win32.whl
Size 34.8 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
97d06363b5ff0b1d362eb9d64a8d7199e0b20f2ba8a68851faaec63c53c2bc02
BLAKE2b-256 checksum
How to use checksums
4d0fe50abdb7426c9dd1201380f1a82806c64ef03fb5449858c02d49bfd329d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 7, 2025.

Transparency log

Release files / re_patchright-1.52.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL re_patchright-1.52.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 44.5 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
0ee00852dc6bd3193f8d5bef3632326861a62c25ce1308f1c891f5b89643fca3
BLAKE2b-256 checksum
How to use checksums
3c352867c700692498df1512eb87ebaf23bc6016af01a432a89a515935d5cc2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 7, 2025.

Transparency log

Release files / re_patchright-1.52.10-py3-none-manylinux1_x86_64.whl

Download URL re_patchright-1.52.10-py3-none-manylinux1_x86_64.whl
Size 45.1 MB
Tags Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f945f62653ecc91d341f6aa8b5483bacadaba01b79c7db77a1cafd3c37c1cd0f
BLAKE2b-256 checksum
How to use checksums
b07f4d530cc3a2b6abe954833656f075059d383364ec93e76d93e1997f841e02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 7, 2025.

Transparency log

Release files / re_patchright-1.52.10-py3-none-macosx_11_0_universal2.whl

Download URL re_patchright-1.52.10-py3-none-macosx_11_0_universal2.whl
Size 39.6 MB
Tags Python 3 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
a82d2a084f6d023085eceaefa0f56309c13455a703e3c84d0bea44efa1d461b9
BLAKE2b-256 checksum
How to use checksums
3a70c70c9dcd94dc3bb9230d280c6063353867af2e602101c34ae9f34344b0db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 7, 2025.

Transparency log

Release files / re_patchright-1.52.10-py3-none-macosx_11_0_arm64.whl

Download URL re_patchright-1.52.10-py3-none-macosx_11_0_arm64.whl
Size 37.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f5aa9e42974e328cf6597565f1560f134c798b8d14ca3f0ff692ab0a1970507f
BLAKE2b-256 checksum
How to use checksums
2c04716f63293d41a936bf1d950c12bef49dc9066273ccd9e2ee7faa38816517
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 7, 2025.

Transparency log

Release files / re_patchright-1.52.10-py3-none-macosx_10_13_x86_64.whl

Download URL re_patchright-1.52.10-py3-none-macosx_10_13_x86_64.whl
Size 39.6 MB
Tags Python 3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
e04bdea7e96241bdfd91e256e7de341f54262909e0b955ad305beeed2c43f549
BLAKE2b-256 checksum
How to use checksums
284b0539e459c0af6ac5f7133717a8da20447bf63c18d468871fa86c8bf84221
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 7, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.52.10 This release

8 release files

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