What is Playwright or Puppeteer with stealth plugins And can you compare it to selenium

Playwright / Puppeteer with Stealth Plugins vs Selenium

What are Playwright and Puppeteer?

Puppeteer and Playwright are modern browser automation libraries developed by (or inspired by) Google and Microsoft respectively. They control browsers programmatically via the Chrome DevTools Protocol (CDP) or WebDriver BiDi.
FeaturePuppeteerPlaywright
DeveloperGoogleMicrosoft
BrowsersChrome/Chromium (+ Firefox experimentally)Chrome, Firefox, Safari (WebKit)
LanguageJavaScript/TypeScriptJS/TS, Python, Java, C#
API StyleAsync/awaitAsync/await
Built-in stealthNo (needs plugin)Partial (better defaults)

What are Stealth Plugins?

By default, headless browsers expose signals that websites use to detect bot traffic. Stealth plugins patch these fingerprinting vectors.

Common detection signals patched:

SignalWhat it leaksStealth fix
navigator.webdrivertrue in headless modeOverride to undefined
Chrome runtime objectMissing in headlessInject fake window.chrome
Permissions APIHeadless returns odd valuesNormalize responses
User-AgentContains "HeadlessChrome"Replace with real UA string
WebGL / Canvas fingerprintDiffers from real browsersSpoof GPU/renderer info
Plugin/MIME arraysEmpty in headlessInject realistic plugin lists
Language & timezoneInconsistent headersAlign navigator.language, timezone

Popular plugins:

  • puppeteer-extra-plugin-stealth — most widely used, patches ~20 evasion vectors for Puppeteer
  • playwright-extra + stealth plugin — same ecosystem ported to Playwright
  • undetected-chromedriver — Python equivalent for Puppeteer-style stealth (but for CDP)

Example (Puppeteer + Stealth):

const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');

puppeteer.use(StealthPlugin());

const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.goto('https://bot.sannysoft.com'); // bot detection test

Comparison: Playwright/Puppeteer vs Selenium

DimensionPlaywright / PuppeteerSelenium
ProtocolCDP / BiDi (direct browser pipe)WebDriver (HTTP-based W3C standard)
SpeedFaster (native protocol, no HTTP overhead)Slower (JSON Wire Protocol over HTTP)
Browser supportPlaywright: Chrome, Firefox, Safari; Puppeteer: ChromeAll major browsers + IE
Language supportJS/TS primarily (Playwright adds Python, Java, C#)Python, Java, C#, Ruby, JS, and more
Stealth / bot evasionBetter baseline; stealth plugins availableHarder — WebDriver flag is deeply embedded
navigator.webdriverEasily patchedDifficult to hide; often still detectable
Auto-waitBuilt-in smart waiting (Playwright)Manual WebDriverWait required
Test featuresPlaywright has built-in tracing, screenshots, videoRequires 3rd-party tools (Allure, etc.)
Network interceptionNative and easyLimited (requires proxy or BrowserMob)
Mobile emulationNative device emulationLimited
Community/ecosystemNewer, fast-growingMature, massive ecosystem
Grid/parallel executionPlaywright Test runner, Playwright GridSelenium Grid (battle-tested)
Enterprise useGrowing adoptionIndustry standard for years

Bot Detection: Why Selenium is Harder to Stealth

Selenium relies on the WebDriver protocol, which injects a webdriver property into the browser at a low level. This is much harder to suppress cleanly. Even with tools like undetected-chromedriver, detection is more fragile.
Playwright and Puppeteer communicate via CDP directly, making it easier to:
  • Intercept and patch navigator properties before page scripts run
  • Inject scripts at document creation time (page.evaluateOnNewDocument)
  • Manage timing and fingerprinting at a lower level

When to Use What

Use CaseBest Tool
Web scraping with bot evasionPlaywright + stealth or Puppeteer + stealth
Cross-browser enterprise test suiteSelenium
Modern end-to-end testingPlaywright
Legacy browser (IE) supportSelenium
Fast, headless automation pipelinesPlaywright or Puppeteer
Large team with existing Java/Ruby infraSelenium

Bottom line: Playwright/Puppeteer with stealth plugins are the go-to choice for scraping and bot-evasion tasks. Selenium remains dominant in enterprise QA environments where cross-browser support, language diversity, and existing infrastructure matter more than stealth or speed.
This is a shared conversation. Sign in to Orris to start your own chat.