SpoofBrowser

Selenium and Playwright on Anti-Detect Browsers β€” 2026 Guide

Driving anti-detect profiles from Selenium / Playwright code: connect, control, avoid driver fingerprints.

Β· SpoofBrowser Editorialautomationseleniumplaywrightguide

Selenium 4 and Playwright 1.40+ work with most anti-detect browsers through the same protocol Chrome DevTools uses. The catch: stock automation libs leak driver fingerprints that defeat the entire anti-detect.

Connecting

Afina, Multilogin, Octo, and most premium products expose a local API:

# Python + Playwright
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp("ws://localhost:3030/p/abc123")
    context = browser.contexts[0]
    page = context.new_page()
    page.goto("https://spoofbrowser.com")

The local WebSocket URL is per-profile. Open the profile, get the URL, connect.

What anti-detect handles for you

Stock Chromium driven by Selenium leaks:

  • navigator.webdriver === true
  • window.chrome.runtime patterns
  • Chrome DevTools Protocol events
  • WebGL renderer changes when in headless mode

A proper anti-detect intercepts all of these. The profile, when driven by automation, looks identical to the same profile driven by a human.

Behavioural humaniser

Even with clean fingerprints, mouse-perfect automation flags. Use a humaniser:

  • Afina Scenarios β€” built-in
  • Manual β€” random delays, random BΓ©zier mouse paths
  • Library β€” playwright-extra-stealth (works but redundant on Afina)

Tips

  • Set viewport before navigation, not after
  • Use context.set_extra_http_headers for any custom headers, not page.set_extra_http_headers β€” context-level is more consistent
  • Wait for networkidle instead of fixed sleeps where possible
  • Don't use headless mode with anti-detect β€” defeats the purpose

Verification

After automating, run the resulting profile against iphey.com and demo.fingerprint.com. Should be all-green. If anything is off, your automation is fingerprinting.

Bottom line

Selenium / Playwright on a proper anti-detect (Afina, Octo, Multilogin) is automation-grade. Adding stealth plugins on top is unnecessary and sometimes counter-productive.

Frequently Asked Questions

Does Selenium / Playwright leak 'webdriver' flag?+
Stock yes; with a proper anti-detect engine, no. Afina / Multilogin / Octo all hide navigator.webdriver and chrome.runtime fingerprints.
puppeteer-extra-stealth required?+
No β€” proper anti-detect engines cover what stealth plugins do, and more. Use stealth only if you're on stock Chromium.
Editor's pick Β· #1 in 2026

Try the top-rated anti-detect browser today

Afina ships a 47-surface fingerprint engine, UDP support, and zero-knowledge encryption at the most generous free tier in the field.

SALE20 Β· 20% off first month, any tierSALE30 Β· 30% off Business tier (annual prepay)