{"id":22016126,"url":"https://github.com/kaliiiiiiiiii-vinyzu/patchright-python","last_synced_at":"2026-03-06T10:10:59.666Z","repository":{"id":260818790,"uuid":"882397352","full_name":"Kaliiiiiiiiii-Vinyzu/patchright-python","owner":"Kaliiiiiiiiii-Vinyzu","description":"Undetected Python version of the Playwright testing and automation library. ","archived":false,"fork":false,"pushed_at":"2025-03-25T19:05:52.000Z","size":37,"stargazers_count":373,"open_issues_count":3,"forks_count":20,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-02T09:55:41.082Z","etag":null,"topics":["automation","bot","bots","botting","browser","chrome","chromedriver","chromium","cloudflare","cloudflare-by","playwright","stealth","undetectable","undetected","web-automation","web-scraping","webautomation","webdriver","webscraping"],"latest_commit_sha":null,"homepage":"https://pypi.org/p/patchright","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kaliiiiiiiiii-Vinyzu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-02T18:12:44.000Z","updated_at":"2025-04-02T07:09:39.000Z","dependencies_parsed_at":"2024-11-02T20:16:30.182Z","dependency_job_id":"41f0a29d-08c8-41f0-bd5f-ec0ecaff0dd3","html_url":"https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python","commit_stats":null,"previous_names":["kaliiiiiiiiii-vinyzu/patchright-python"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kaliiiiiiiiii-Vinyzu%2Fpatchright-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kaliiiiiiiiii-Vinyzu%2Fpatchright-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kaliiiiiiiiii-Vinyzu%2Fpatchright-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kaliiiiiiiiii-Vinyzu%2Fpatchright-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kaliiiiiiiiii-Vinyzu","download_url":"https://codeload.github.com/Kaliiiiiiiiii-Vinyzu/patchright-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027406,"owners_count":21035594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","bot","bots","botting","browser","chrome","chromedriver","chromium","cloudflare","cloudflare-by","playwright","stealth","undetectable","undetected","web-automation","web-scraping","webautomation","webdriver","webscraping"],"created_at":"2024-11-30T04:32:42.754Z","updated_at":"2026-03-06T10:10:59.655Z","avatar_url":"https://github.com/Kaliiiiiiiiii-Vinyzu.png","language":"Python","readme":"\u003ch1 align=\"center\"\u003e\n    🎭 Patchright Python\n\u003c/h1\u003e\n\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-green\"\u003e\n    \u003c/a\u003e\n    \u003ca\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Based%20on-Playwright-goldenrod\"\u003e\n    \u003c/a\u003e\n    \u003ca\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Driver-Patched-blue\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python/actions/workflows/patchright_tests.yml\"\u003e\n        \u003cimg src=\"https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python/actions/workflows/patchright_tests.yml/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python/releases/latest\"\u003e\n        \u003cimg alt=\"Patchright Version\" src=\"https://img.shields.io/github/v/release/microsoft/playwright-python?display_name=release\u0026label=Version\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Package-Python-seagreen\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python/releases\"\u003e\n        \u003cimg alt=\"GitHub Downloads (all assets, all releases)\" src=\"https://img.shields.io/pepy/dt/patchright?color=red\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n#### Patchright is a patched and undetected version of the Playwright Testing and Automation Framework. \u003c/br\u003e It can be used as a drop-in replacement for Playwright.\n\n\u003e [!NOTE]  \n\u003e This repository serves the Patchright-Python Package. To use Patchright with NodeJS, check out the [NodeJS Package](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-nodejs).\n\u003e Also check out the main [Patchright Driver Repository](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright)\n\n---\n\n\u003cdetails open\u003e\n    \u003csummary\u003e\u003ch3\u003eSponsors\u003c/h1\u003e\u003c/summary\u003e\n\n\u003ca href=\"https://www.thordata.com/?ls=github\u0026lk=Vinyzu\" target=\"_blank\"\u003e\n  \u003cimg alt=\"Thordata Banner\" src=\"https://github.com/user-attachments/assets/58460bff-b057-4191-88da-80e0bd29b745\" width=\"90%\" /\u003e\n\u003c/a\u003e\n\n[Thordata](https://www.thordata.com/?ls=github\u0026lk=Vinyzu) - Your First Plan is on Us! 💰Get 100% of your first residential proxy purchase back as wallet balance, up to $900.\n### **⚡ Why Thordata?**\n🌍 190+ real residential \u0026 ISP IP locations\\\n🔐 Fully encrypted, ultra-secure connections\\\n🚀 Optimized for web scraping, ad verification \u0026 automation workflows\n\n🔥Don’t wait — this is your **best time to start** with [Thordata](https://www.thordata.com/?ls=github\u0026lk=Vinyzu) and experience the safest, fastest proxy network.\n\n\u003c/details\u003e\n\n---\n\n## Install it from PyPI\n\n```bash\n# Install Patchright with Pip from PyPI\npip install patchright\n```\n\n```bash\n# Install Chromium-Driver for Patchright\npatchright install chromium\n```\n\n---\n\n## Usage\n#### Just change the import and use it like playwright. Patchright is a drop-in-replacement for Playwright!\n\n\u003e [!IMPORTANT]  \n\u003e Patchright only patches CHROMIUM based browsers. Firefox and Webkit are not supported.\n\n```py\n# patchright here!\nfrom patchright.sync_api import sync_playwright\n\nwith sync_playwright() as p:\n    browser = p.chromium.launch()\n    page = browser.new_page()\n    page.goto('http://playwright.dev')\n    page.screenshot(path=f'example-{p.chromium.name}.png')\n    browser.close()\n```\n\n```py\nimport asyncio\n# patchright here!\nfrom patchright.async_api import async_playwright\n\nasync def main():\n    async with async_playwright() as p:\n        browser = await p.chromium.launch()\n        page = await browser.new_page()\n        await page.goto('http://playwright.dev')\n        await page.screenshot(path=f'example-{p.chromium.name}.png')\n        await browser.close()\n\nasyncio.run(main())\n```\n\n### Best Practice  - use Chrome without Fingerprint Injection\n\nTo be completely undetected, use the following configuration:\n```py\nplaywright.chromium.launch_persistent_context(\n    user_data_dir=\"...\",\n    channel=\"chrome\",\n    headless=False,\n    no_viewport=True,\n    # do NOT add custom browser headers or user_agent\n    ...\n)\n```\n\n\u003e [!NOTE]  \n\u003e We recommend using Google Chrome instead of Chromium.\n\u003e You can install it via `patchright install chrome` (or via any other installation method) and use it with `channel=\"chrome\"`.\n\n---\n\n## Patches\n\n### [Runtime.enable](https://vanilla.aslushnikov.com/?Runtime.enable) Leak\nThis is the biggest Patch Patchright uses. To avoid detection by this leak, patchright avoids using [Runtime.enable](https://vanilla.aslushnikov.com/?Runtime.enable) by executing Javascript in (isolated) ExecutionContexts.\n\n### [Console.enable](https://vanilla.aslushnikov.com/?Console.enable) Leak\nPatchright 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.\n\n### Command Flags Leaks\nPatchright tweaks the Playwright Default Args to avoid detection by Command Flag Leaks. This (most importantly) affects:\n- `--disable-blink-features=AutomationControlled` (added) to avoid navigator.webdriver detection.\n- `--enable-automation` (removed) to avoid navigator.webdriver detection.\n- `--disable-popup-blocking` (removed) to avoid popup crashing.\n- `--disable-component-update` (removed) to avoid detection as a Stealth Driver.\n- `--disable-default-apps` (removed) to enable default apps.\n- `--disable-extensions` (removed) to enable extensions\n\n### General Leaks\nPatchright patches some general leaks in the Playwright codebase. This mainly includes poor setups and obvious detection points.\n\n### Closed Shadow Roots\nPatchright is able to interact with elements in Closed Shadow Roots. Just use normal locators and Patchright will do the rest.\n\u003cbr/\u003e\nPatchright is now also able to use XPaths in Closed Shadow Roots.\n\n---\n\n## Stealth\n\nWith the right setup, Patchright currently is considered undetectable.\nPatchright passes:\n- [Brotector](https://kaliiiiiiiiii.github.io/brotector/) ✅ (with [CDP-Patches](https://github.com/Kaliiiiiiiiii-Vinyzu/CDP-Patches/))\n- [Cloudflare](https://cloudflare.com/) ✅\n- [Kasada](https://www.kasada.io/) ✅\n- [Akamai](https://www.akamai.com/products/bot-manager/) ✅\n- [Shape/F5](https://www.f5.com/) ✅\n- [Bet365](https://bet365.com/) ✅\n- [Datadome](https://datadome.co/products/bot-protection/) ✅\n- [Fingerprint.com](https://fingerprint.com/products/bot-detection/) ✅\n- [CreepJS](https://abrahamjuliot.github.io/creepjs/) ✅\n- [Sannysoft](https://bot.sannysoft.com/) ✅\n- [Incolumitas](https://bot.incolumitas.com/) ✅\n- [IPHey](https://iphey.com/) ✅\n- [Browserscan](https://browserscan.net/) ✅\n- [Pixelscan](https://pixelscan.net/) ✅\n\n---\n\n## Documentation and API Reference\nSee the original [Playwright Documentation](https://playwright.dev/python/docs/intro) and [API Reference](https://playwright.dev/python/docs/api/class-playwright)\n\n## Extended Patchright API\n#### **`evaluate`** Method \u003csub\u003e([`Frame.evaluate`](https://playwright.dev/python/docs/api/class-frame#frame-evaluate), [`Page.evaluate`](https://playwright.dev/python/docs/api/class-page#page-evaluate),  [`Locator.evaluate`](https://playwright.dev/python/docs/api/class-locator#locator-evaluate),  [`Worker.evaluate`](https://playwright.dev/python/docs/api/class-worker#worker-evaluate), [`JSHandle.evaluate`](https://playwright.dev/python/docs/api/class-jshandle#js-handle-evaluate))\u003c/sub\u003e\n- Added `isolated_context`  to choose Execution Context (Main/Isolated). `Bool` (*optional*, Defaults to `True`)\n```diff\nobject.evaluate(\n    expression: str,\n    arg: typing.Optional[typing.Any] = None,\n    ...,\n+   isolated_context: typing.Optional[bool] = True\n)\n```\n\n#### **`evaluate_handle`** Method \u003csub\u003e([`Frame.evaluate_handle`](https://playwright.dev/python/docs/api/class-frame#frame-evaluate-handle), [`Page.evaluate_handle`](https://playwright.dev/python/docs/api/class-page#page-evaluate-handle), [`Locator.evaluate_handle`](https://playwright.dev/python/docs/api/class-locator#locator-evaluate-handle), [`Worker.evaluate_handle`](https://playwright.dev/python/docs/api/class-worker#worker-evaluate-handle), [`JSHandle.evaluate`](https://playwright.dev/python/docs/api/class-jshandle#js-handle-evaluate-handle))\u003c/sub\u003e\n- Added `isolated_context`  to choose Execution Context (Main/Isolated). `Bool` (*optional*, Defaults to `True`)\n```diff\nobject.evaluate_handle(\n    expression: str,\n    arg: typing.Optional[typing.Any] = None,\n    ...,\n+   isolated_context: typing.Optional[bool] = True\n)\n```\n\n#### **`evaluate_all`** Method \u003csub\u003e([`Locator.evaluate_all`](https://playwright.dev/python/docs/next/api/class-locator#locator-evaluate-all))\u003c/sub\u003e\n- Added `isolated_context`  to choose Execution Context (Main/Isolated). `Bool` (*optional*, Defaults to `True`)\n```diff\nLocator.evaluate_all(\n    expression: str,\n    arg: typing.Optional[typing.Any] = None,\n    ...,\n+   isolated_context: typing.Optional[bool] = True\n)\n```\n\n\n---\n\n## Bugs\n#### The bugs are documented in the [Patchright Driver Repository](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright#bugs).\n\n---\n\n### TODO\n#### The TODO is documented in the [Patchright Driver Repository](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright#todo).\n\n\n---\n\n## Development\n\nDeployment 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. \n\n---\n\n## Support our work\n\nIf you choose to support our work, please contact [@vinyzu](https://discord.com/users/935224495126487150) or [@steve_abcdef](https://discord.com/users/936292409426477066) on Discord.\n\n---\n\n## Copyright and License\n© [Vinyzu](https://github.com/Vinyzu/)\n\nPatchright is licensed [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)\n\n---\n\n## Disclaimer\n\nThis repository is provided for **educational purposes only**. \\\nNo 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.\\\n**Any misuse or legal violations are the sole responsibility of the user**. \n\n---\n\n## Authors\n\n#### Active Maintainer: [Vinyzu](https://github.com/Vinyzu/) \u003c/br\u003e Co-Maintainer: [Kaliiiiiiiiii](https://github.com/kaliiiiiiiiii/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliiiiiiiiii-vinyzu%2Fpatchright-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaliiiiiiiiii-vinyzu%2Fpatchright-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliiiiiiiiii-vinyzu%2Fpatchright-python/lists"}