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.


NodeMaven Banner

NodeMaven: Your reliable proxy provider with High Quality IPs.
Superb solution for automation, web scraping, SEO research, and social media management.

Why NodeMaven?

✅ 99.9% Uptime
🎯 Sticky sessions up to 7 days
🔍 IP Filtering: Proxies are guaranteed to have fraud score <97%
🔰 No KYC required
💸 Cashback on Traffic - Burn GB and earn up to 10% back

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.


ColaProxy Banner

ColaProxy : Low-Cost Residential Proxies for Scalable Automation, Scraping, and Global Data Access

Why choose ColaProxy?

  • Dynamic Residential Proxies from as low as $0.3/GB
  • Massive residential IP pool across 195+ countries
  • 99.9% uptime with stable and fast connections
  • HTTP / HTTPS / SOCKS5 protocol support
  • Rotating & sticky sessions for flexible automation
  • Precise country-level geo-targeting
  • 24/7 expert support

Need reliable proxies for Patchright automation? ColaProxy offers cost-effective residential, ISP, and mobile proxy solutions for scraping, testing, account management, SEO monitoring, and global data collection. Use coupon code COLA20 to enjoy 20% off your order.

Affordable, stable, and built for developers. Start scaling your Patchright projects with ColaProxy.


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.61.1-py3-none-win_arm64.whl (33.9 MB view details)

Uploaded Python 3Windows ARM64

patchright-1.61.1-py3-none-win_amd64.whl (37.8 MB view details)

Uploaded Python 3Windows x86-64

patchright-1.61.1-py3-none-win32.whl (37.8 MB view details)

Uploaded Python 3Windows x86

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

patchright-1.61.1-py3-none-manylinux1_x86_64.whl (47.4 MB view details)

Uploaded Python 3

patchright-1.61.1-py3-none-macosx_11_0_universal2.whl (43.4 MB view details)

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

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

Uploaded Python 3macOS 11.0+ ARM64

patchright-1.61.1-py3-none-macosx_10_13_x86_64.whl (43.4 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: patchright-1.61.1-py3-none-win_arm64.whl
  • Upload date:
  • Size: 33.9 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.61.1-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 be79b2931a76a93e77b2e75970be5e4a65ed856de1f6cd170386fbc78f7f55a8
MD5 d50dbcc8ddf20ce046e288b7fa25a80c
BLAKE2b-256 c9b02e83f9245e08db9f5d1ed10e5be581feac18ed3b5eadd5dbe32aa487567b

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.61.1-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.61.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: patchright-1.61.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 37.8 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.61.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 8514e5a7da062481c82646b27d293f6efcb1e766500bc0157f4cadee54b6b61f
MD5 055d3e4af268dea98f1d1aa170e08976
BLAKE2b-256 745472956af5c01b7f7aa44760f3b67f779705cef91960618c0bd6a7368e67bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.61.1-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.61.1-py3-none-win32.whl.

File metadata

  • Download URL: patchright-1.61.1-py3-none-win32.whl
  • Upload date:
  • Size: 37.8 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.61.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 091ec4374e8d5c2f64e1b5a50b3ac172598bd0be86b9fd687e87d773784aaa80
MD5 d69637a3996afe0b5ff3386baae97d72
BLAKE2b-256 3040448a04f81ab7d8ad767a6ac5f4c49409659f370e153aefdbde4d3cc1051a

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.61.1-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.61.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for patchright-1.61.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ee8a4b3b33033d50ee796472f47660c04ddb60ec7f30479a5df82f5019689cb4
MD5 015953e70e8a71c4fe72b454d5d0f51b
BLAKE2b-256 10ae2d83365f6d395d3a773a58e8e7da2fb8d3e26a62d1f8d9f78b9b37072570

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.61.1-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.61.1-py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for patchright-1.61.1-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e73473c9b651b51068320dcafee6cce1edb9e0107c986b851f60ad0cad468a2a
MD5 687e426cfa2a5d110d17ffec9726ca41
BLAKE2b-256 e4bea1ac13ddebcb96fc87402796196de1fdd46657239794ddd2ab42de0aff7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.61.1-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.61.1-py3-none-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for patchright-1.61.1-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 dbbb304e1fbfdb1add88109787ef328544c80d5c79a3e4195a618b48be13045e
MD5 6481ef18ea744e3803880bae9544a823
BLAKE2b-256 3d6bf7e494b15dd8cfb2622e1d9936b2fca25d2552ae9627d1b37223c4c1a493

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.61.1-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.61.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for patchright-1.61.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 110a33e664ea35dba58bbb7cc90ffcb80599b0a5c30cf18128c73e6b59d1e243
MD5 59c2d0492216641132399a6669400297
BLAKE2b-256 400e187aa0cc1b40ebf55a5eb7caf442296d2b4a5bcfbc518d70b260aaf4ad2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.61.1-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.61.1-py3-none-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for patchright-1.61.1-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 c31720d60e03a5d409fddebbaf75cd2d6193424648582efed9c6828be8f5bb13
MD5 25035734c0a470aed12bb686589f0ef5
BLAKE2b-256 016db565dd267090ae04d3d180a6264feade107da29ed2adbcdd0e9395eff20d

See more details on using hashes here.

Provenance

The following attestation bundles were made for patchright-1.61.1-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