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.webdriverin launched browsers. Not relevant when connecting to Driver, but Patchright removes them anyway.
Install
Connect
Migrating from Playwright
Change the import. That’s the whole migration.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, broadpage.route interception, injected init scripts, overridden navigator properties or a thousand clicks a minute still look like a bot. See best practices.