Skip to main content

Undetected Python version of the Playwright testing and automation library.

Project description

🎭 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


Sponsors

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


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.


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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

patchright-1.60.0-py3-none-win_arm64.whl (34.0 MB view details)

Uploaded Python 3Windows ARM64

patchright-1.60.0-py3-none-win_amd64.whl (37.9 MB view details)

Uploaded Python 3Windows x86-64

patchright-1.60.0-py3-none-win32.whl (37.9 MB view details)

Uploaded Python 3Windows x86

patchright-1.60.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (47.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

patchright-1.60.0-py3-none-manylinux1_x86_64.whl (47.5 MB view details)

Uploaded Python 3

patchright-1.60.0-py3-none-macosx_11_0_universal2.whl (43.5 MB view details)

Uploaded Python 3macOS 11.0+ universal2 (ARM64, x86-64)

patchright-1.60.0-py3-none-macosx_11_0_arm64.whl (42.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

patchright-1.60.0-py3-none-macosx_10_13_x86_64.whl (43.5 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

File details

Details for the file patchright-1.60.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: patchright-1.60.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 34.0 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for patchright-1.60.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 80912aa39d1870887fada712c3e355d18862148d184bcbbbed82eb7bc6d51fcf
MD5 08f04fe8829a4a730fbc2b8d39da0f5b
BLAKE2b-256 6c8c633aa6a9a3938c70105e8c5e80e1278a4796a8ebdb4774762e0491856289

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.60.0-py3-none-win_arm64.whl:

Publisher: patchright_release.yml on Kaliiiiiiiiii-Vinyzu/patchright-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file patchright-1.60.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: patchright-1.60.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 37.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for patchright-1.60.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d2b68c09269d6d96817a211e93df047361ccb159826cda2595a9a028d337d2ea
MD5 adf6fe88a83f8c509945e07cd43787c4
BLAKE2b-256 5586a626155b45559538dfa99af4c8405706acceb8981d4fb953525160df044b

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.60.0-py3-none-win_amd64.whl:

Publisher: patchright_release.yml on Kaliiiiiiiiii-Vinyzu/patchright-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file patchright-1.60.0-py3-none-win32.whl.

File metadata

  • Download URL: patchright-1.60.0-py3-none-win32.whl
  • Upload date:
  • Size: 37.9 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for patchright-1.60.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 536f4ef4d6f2bb5e48d61493559b34aaac83d82beaad2185b69eb7088f4948bd
MD5 da1b3907dd4e6b3394a9c29e8aae0eb3
BLAKE2b-256 67edf13179bc28ac1c74e19d4041982a8eaacecb8e4fb3bcbd7135af18a45ea6

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.60.0-py3-none-win32.whl:

Publisher: patchright_release.yml on Kaliiiiiiiiii-Vinyzu/patchright-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file patchright-1.60.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for patchright-1.60.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e37301a8b960f3200087ba57b9b56921262d6c573e95f2b8b64e0ecf0fb0547c
MD5 29002e8046ec1394753252864e7efc95
BLAKE2b-256 a22bb4783fbdd607eb346efa5c4fff8abc8a55d22bce83ada0c15f894374ef9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.60.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: patchright_release.yml on Kaliiiiiiiiii-Vinyzu/patchright-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file patchright-1.60.0-py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for patchright-1.60.0-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7a5bbb2ced890a92e05af6eea69d01ad58602050b491276d3137d1f1290ffbe1
MD5 f638c55a87751c6a85324cef4c1dbe63
BLAKE2b-256 dc0e37b7dd4b0e7db24148fb3fcc73ccb36d9c82a3f5c7c8300c45ed8a76b7f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.60.0-py3-none-manylinux1_x86_64.whl:

Publisher: patchright_release.yml on Kaliiiiiiiiii-Vinyzu/patchright-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file patchright-1.60.0-py3-none-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for patchright-1.60.0-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 9896a180d5126b0ee89253d11d0bed3c8fba7e605fac8669e8a06173d55a2984
MD5 2480ad4fc4fa6a37ec1c1b2e0938229b
BLAKE2b-256 28908bde3f3177928a440730e522ccc7120cd022bb458be51b23032aa83b0619

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.60.0-py3-none-macosx_11_0_universal2.whl:

Publisher: patchright_release.yml on Kaliiiiiiiiii-Vinyzu/patchright-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file patchright-1.60.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for patchright-1.60.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4380d7af8c14a0cf43527d3e24bdb66d1f9f68bf6d2bcd80109acf1028721b44
MD5 e6001832dbb317b5954128b5d842c15a
BLAKE2b-256 1aaf0b92c6674b10be0c97eb37b79424d2681228f2f9dddadecdffae894853f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.60.0-py3-none-macosx_11_0_arm64.whl:

Publisher: patchright_release.yml on Kaliiiiiiiiii-Vinyzu/patchright-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file patchright-1.60.0-py3-none-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for patchright-1.60.0-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 c33dadd9b046142d41cf0b2791de709552b434968b0c6e40e843f803c685fde0
MD5 17c844f81e7dacd10af8eee7010bf164
BLAKE2b-256 667c8ae675e3a55bfb3f71aff58ccfa808322cd193f87dfe4a452601063b96d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.60.0-py3-none-macosx_10_13_x86_64.whl:

Publisher: patchright_release.yml on Kaliiiiiiiiii-Vinyzu/patchright-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page