Skip to main content

🎭 Patchright Python


Patchright Version PyPI Downloads

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!

NodeMaven Banner

NodeMaven: Your efficient proxy provider for Web Scraping and Automation with High Quality IPs.


Why NodeMaven?

🎯 ZIP targeting
✅ 99.9% Uptime
🔍 IP Filtering: Proxies are guaranteed to have fraud score <97%
🔰 No KYC required
🎉 Unique free tools: Proxy Bandwidth Checker, Meta Tag Checker, IP Lookup and others!

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.


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.


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.


Scrappey

Sponsored by Scrappey

Getting the browser past detection is one problem. Keeping proxies rotating, fingerprints current and sessions alive across a few million requests is a different one. Scrappey takes the second problem: one endpoint, solved pages back.

  • Clearcote — our own patched Chromium, maintained in-house, not a stock build
  • Several engines behind one endpoint — blocked on one stack, routed to another
  • Click, type, wait and scroll over the API — a real session, not a fetch proxy
  • Residential and datacenter proxies included, or bring your own
  • Per request, no monthly minimum
curl -X POST "https://publisher.scrappey.com/api/v1?key=YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cmd": "request.get", "url": "https://example.com"}'

Get 10% off with code PATCHRIGHT

Documentation · Discord · Get an API key


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

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

Uploaded Python 3Windows ARM64

patchright-1.62.3-py3-none-win_amd64.whl (38.2 MB view details)

Uploaded Python 3Windows x86-64

patchright-1.62.3-py3-none-win32.whl (38.2 MB view details)

Uploaded Python 3Windows x86

patchright-1.62.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (47.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

patchright-1.62.3-py3-none-manylinux1_x86_64.whl (47.7 MB view details)

Uploaded Python 3

patchright-1.62.3-py3-none-macosx_11_0_universal2.whl (43.7 MB view details)

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

patchright-1.62.3-py3-none-macosx_11_0_arm64.whl (42.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

patchright-1.62.3-py3-none-macosx_10_13_x86_64.whl (43.7 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: patchright-1.62.3-py3-none-win_arm64.whl
  • Upload date:
  • Size: 34.2 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for patchright-1.62.3-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 22c50ef98b192000a8501bbf1a1e188660b5b63b626c4efce5fafe71dc8d27bf
MD5 0c0f8cfc448e533f41b2e9f15d4440b9
BLAKE2b-256 a86d52b9365d6dc8582af1e94af88dbc4c8d1ebd03feecd5d0acafb6fcfc0f60

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for patchright-1.62.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ccca9f1fa9fc4e9cdc2cdd784d4bb0e992e83defaec60e5a5d2d31cad9bd785a
MD5 70aa1d7183aeb5662f7ce75bb53bc05d
BLAKE2b-256 c7b76aefc1767deed5f0dbac23fc35bb23b370f0db77968923af07708caa3947

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: patchright-1.62.3-py3-none-win32.whl
  • Upload date:
  • Size: 38.2 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for patchright-1.62.3-py3-none-win32.whl
Algorithm Hash digest
SHA256 f70d0672a551e5a8b9f36a823ccc47361667cdbdb85c77205555a0450fa4149d
MD5 141b5842ca8da94d63a961f768167ca2
BLAKE2b-256 64514a117b30fb1ed480a173580b4ea82267d2d10b38bc0e43c1a8d0cec2dcf3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for patchright-1.62.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f6453c3a5067d44608ff08727c2ad5c5c3305d577162934bcbfa609a78ec5fe7
MD5 b44848f92389ca92f08cec819295bc05
BLAKE2b-256 86d678af3bfff6c778a94f9d76ba70eb5b85d9ea67e280bf2008c9d9c6559224

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for patchright-1.62.3-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d652b4e5f3a7cc8e8d9e896d1c95853feeb99bcd63ac9439538cf9a752a6c82c
MD5 e12137cd95982a35eae6ef88eb3a82b6
BLAKE2b-256 c7c62e78216dd206aa7c4031432162962881c3abd7b1f246cf5ec0ad445da426

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for patchright-1.62.3-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 88edcf3d04eb4ab7f041cf92a28e0e2f00ad8ef24fc3d2b4ea134000b9474185
MD5 c76aece961d38a9a1e64d62c5fc5b60b
BLAKE2b-256 403477e52d126ef36defbd9bce5b1ec8096fcfc4bc5cfe5afb3c46b4a1033a82

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for patchright-1.62.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4bdbe4e0ff224d02b27f154040049d30f4bbabe39f511910c3aa846d04d997ae
MD5 7e5f8b77a580c63a7f6a52f00c0a066a
BLAKE2b-256 136058a84797867c3404e715d4beb0e393c8643c34b4b54a52870d1fc5a1a32d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for patchright-1.62.3-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 5d9e45c300b72ebc90cc9434da4e06222fdcad18ba473bd6859169421bf37fe3
MD5 6e04e8cb04bdd645b68a697c9db590b7
BLAKE2b-256 9fac990b4d42a1b8a2827b80a19be29ed4976ef52dfde56fa2eaac638b57957f

See more details on using hashes here.

Provenance

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

Release history Release notifications | RSS feed

This release

1.62.3 This release

8 files

1.62.2

8 files

1.62.1

8 files

1.61.2

8 files

1.61.1

8 files

1.60.1

8 files

1.60.0

8 files

1.59.1

8 files

1.58.2

8 files

1.58.1

8 files

1.58.0

8 files

1.57.2

8 files

1.57.1

8 files

1.57.0

8 files

1.56.0

8 files

1.55.2

8 files

1.55.1

8 files

1.55.0

8 files

1.52.5

8 files

1.52.4

8 files

1.52.3

8 files

1.52.2

8 files

1.52.0

8 files

1.51.3

7 files

1.51.0

7 files

1.50.0

7 files

1.49.1

7 files

1.49.0

7 files

1.48.0.post0

7 files

0.0.1

2 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