Undetected Python version of the Playwright testing and automation library.
1,509
stars
82
commits
Python
primary language
Sep 9, 2026
updated
[!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
Want to Sponsor this Project? Contact @vinyzu on Discord!
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.
Best for: Web scraping, automation, multi-accounting, and large-scale data extraction
RapidProxy delivers:
Start fast. Scale globally. Stay stable with RapidProxy.
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.
Why choose ColaProxy?
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.
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.
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
# Install Patchright with Pip from PyPI
pip install patchright
# Install Chromium-Driver for Patchright
patchright install chromium
[!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())
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 viapatchright install chrome(or via any other installation method) and use it withchannel="chrome".
This is the biggest Patch Patchright uses. To avoid detection by this leak, patchright avoids using Runtime.enable by executing Javascript in (isolated) ExecutionContexts.
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.
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 extensionsPatchright patches some general leaks in the Playwright codebase. This mainly includes poor setups and obvious detection points.
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.
With the right setup, Patchright currently is considered undetectable. Patchright passes:
See the original Playwright Documentation and API Reference
evaluate Method (Frame.evaluate, Page.evaluate, Locator.evaluate, Worker.evaluate, JSHandle.evaluate)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)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)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
)
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.
If you choose to support our work, please contact @vinyzu or @steve_abcdef on Discord.
Β© Vinyzu
Patchright is licensed Apache 2.0
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.
Python
95.6%
Shell
4.4%
Undetected Python version of the Playwright testing and automation library.
1,509
stars
82
commits
Python
primary language
Sep 9, 2026
updated
[!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
Want to Sponsor this Project? Contact @vinyzu on Discord!
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.
Best for: Web scraping, automation, multi-accounting, and large-scale data extraction
RapidProxy delivers:
Start fast. Scale globally. Stay stable with RapidProxy.
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.
Why choose ColaProxy?
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.
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.
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
# Install Patchright with Pip from PyPI
pip install patchright
# Install Chromium-Driver for Patchright
patchright install chromium
[!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())
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 viapatchright install chrome(or via any other installation method) and use it withchannel="chrome".
This is the biggest Patch Patchright uses. To avoid detection by this leak, patchright avoids using Runtime.enable by executing Javascript in (isolated) ExecutionContexts.
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.
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 extensionsPatchright patches some general leaks in the Playwright codebase. This mainly includes poor setups and obvious detection points.
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.
With the right setup, Patchright currently is considered undetectable. Patchright passes:
See the original Playwright Documentation and API Reference
evaluate Method (Frame.evaluate, Page.evaluate, Locator.evaluate, Worker.evaluate, JSHandle.evaluate)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)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)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
)
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.
If you choose to support our work, please contact @vinyzu or @steve_abcdef on Discord.
Β© Vinyzu
Patchright is licensed Apache 2.0
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.
Python
95.6%
Shell
4.4%