Skip to main content
Patchright is a patched build of Playwright. Same API, same docs, same selectors. The difference is what it sends over CDP.

Why Patchright

Stock Playwright and Puppeteer drive the browser with CDP calls a normal Chrome never makes on its own. Anti-bot vendors look for exactly those:
  • Runtime.enable, which exposes every page’s JavaScript world and leaves traces in the page.
  • Console and binding hooks (Runtime.addBinding, Page.addScriptToEvaluateOnNewDocument) that Playwright installs for its own bookkeeping.
  • Command-line switches and navigator.webdriver in launched browsers. Not relevant when connecting to Driver, but Patchright removes them anyway.
Driver gives you real Chrome on real hardware. If the client then announces itself over CDP, the session gets challenged anyway. Patchright removes those signals and keeps the Playwright API.

Install

No browser download. You connect to Driver’s Chrome.

Connect

Migrating from Playwright

Change the import. That’s the whole migration.
Delete any chromium.launch() and any playwright install step. Driver provides the browser. Coming from Puppeteer is a rewrite, not a rename: Patchright has Playwright’s API. Either keep Puppeteer with the connect-only setup and accept its fingerprint, or port.

What Patchright doesn’t fix

Patchright fixes the client, not your script. A fresh context per page, broad page.route interception, injected init scripts, overridden navigator properties or a thousand clicks a minute still look like a bot. See best practices.