Scrapeless Wiki

What Is Patchright? – Definition and How It Works

Informational P2 what is patchright
Overlaps a live page. A published page already targets this keyword: https://www.scrapeless.com/en/blog/nodriver-patchright-undetected. Publishing both risks cannibalisation β€” decide before this goes live.

Learn what Patchright is, which Playwright leaks it closes, why Runtime.enable matters, and what it deliberately leaves to you.

Patchright is a drop-in replacement for Playwright that removes the traces Playwright itself leaves in a page. It keeps the same API, so adopting it is an import change rather than a rewrite.

1. The Leaks It Targets

Playwright is built for testing, not for concealment, and it makes no effort to hide that it is driving the browser. Several of its mechanisms are observable from page JavaScript.

The best known is Runtime.enable. Playwright issues this CDP command so it can evaluate expressions in a page's execution context. Enabling the Runtime domain changes observable behaviour inside the page β€” a script can construct an error, read the stack or the console interaction, and infer that a debugger-grade client is attached. No amount of property spoofing hides it, because the tell is in the browser's behaviour rather than in a value.

Patchright avoids the command, obtaining execution contexts by other means, and closes several smaller tells alongside it: injected script traces, characteristic console interaction, and command-line switches that mark a Playwright-launched browser.

2. Drop-In Usage

The package mirrors Playwright's interface:

from patchright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=False)
    page = browser.new_page()
    page.goto("https://example.com")
    print(page.title())

Existing scripts change at the import line. Selectors, waits, contexts, and fixtures behave as before, which is the main reason to choose it over moving to a different library.

3. What It Does Not Change

Patchright does not alter the fingerprint. Screen metrics, timezone, fonts, WebGL strings, and hardware properties are whatever the underlying browser reports. It does not rotate IPs, and it does not shape request timing.

It also does not make headless mode indistinguishable from headful. Running with a real display, or with Chromium's newer headless mode, remains a separate decision with its own signals.

The honest framing: Patchright removes Playwright-specific evidence. Everything else about looking like a normal visitor is still yours to arrange.

4. Choosing Between the Options

Three tools solve overlapping problems from different directions. Patchright suits a team already invested in Playwright β€” same API, leaks closed. A driver-free Python library like nodriver suits new async work against Chromium. A patched Selenium mode suits an existing WebDriver suite that cannot be rewritten.

None of the three addresses fingerprints or network reputation, and choosing among them on that basis is a category error.

5. Summary

Patchright is Playwright with the automation evidence removed β€” most importantly the Runtime.enable behaviour that property spoofing cannot mask β€” behind an unchanged API. It is a targeted fix for one class of detection, and it leaves fingerprint control, proxy strategy, and request pacing to you.