Web Scraping APIs

What Is Selenium?

What Is Selenium? — conceptual illustration
On this page

Selenium is the original cross-browser automation framework — the W3C WebDriver standard predates Puppeteer by a decade. It drives Chrome, Firefox, Safari, Edge, and even mobile browsers (Appium under the hood) through a single API in Python, Java, Ruby, C#, JavaScript, Kotlin, and more. In 2026 scraping it remains the right pick when you need Safari or mobile-browser support, or when you have existing Selenium tests to repurpose. For new Python or Node scrapers, Playwright has overtaken it.

Quick facts

StandardW3C WebDriver protocol (oldest of the browser-automation standards)
LanguagesPython, Java, C#, JavaScript, Ruby, Kotlin, and others
BrowsersChrome, Firefox, Safari, Edge, mobile via Appium
Default detectionnavigator.webdriver === true on every browser (W3C-mandated)
Stealth variantsundetected-chromedriver, SeleniumBase UC mode, selenium-stealth

Why Selenium is still relevant in 2026

Three durable reasons to pick Selenium:

  • Safari support. Playwright's WebKit isn't Safari — it's the WebKit engine without Safari's shell. Real Safari testing or scraping requires Selenium + safaridriver.
  • Mobile browsers. Appium (the mobile sibling of Selenium) drives mobile Chrome, mobile Safari, and native apps through the same WebDriver API. No other framework reaches this surface.
  • Existing test code. Half of QA automation in the enterprise is Selenium. If your team maintains a test suite, reusing the framework for scraping is faster than rewriting.

For greenfield Python or Node Chromium scraping, Playwright is the better pick — modern API, faster startup, better parallelism. Selenium's WebDriver wire protocol adds a millisecond-per-command overhead that adds up over a long script.

Selenium's detection surface

Selenium is the most-detected of the three big browser-automation frameworks because:

  • WebDriver is W3C-standardised to set navigator.webdriver = true. Every Selenium browser exposes this by default. Anti-bot scripts test it as the first line of detection.
  • Selenium injects identifying properties into windowwindow.cdc_* keys, window.$cdc_*, others — that anti-bot scripts grep for.
  • The WebDriver wire protocol leaves timing artifacts — command/response latency that differs from real user input by a measurable margin.
  • The chromedriver binary itself has shipped with the substring "$cdc_" in its source for years (only recently patched in mainline).

Vanilla Selenium gets blocked on any modern protected site. The fixes are the stealth variants in the next section.

undetected-chromedriver and SeleniumBase UC mode

Two production stealth approaches for Selenium:

  • undetected-chromedriver (UC) — patches the chromedriver binary on download to remove the $cdc_ strings and overrides navigator.webdriver. Defeats most Layer-1 and Layer-2 checks. Loses to Function.toString() inspection because the override is a JS function.
  • SeleniumBase UC mode — wraps undetected-chromedriver with a pytest-friendly API, adds Cloudflare-Turnstile auto-click, and exposes a clean sb.uc_* method set. The default choice when you want Selenium plus stealth plus a test framework.
  • selenium-driverless — drops the WebDriver layer entirely and drives Chrome via raw CDP, eliminating the WebDriver fingerprint at the cost of the cross-browser support that made you pick Selenium in the first place.

Even with UC, Selenium loses to Kasada, F5 Shape, and recent Akamai. For those, switch to Camoufox, CloakBrowser, or a managed API — the WebDriver protocol itself is the bottleneck.

Code example

python
# undetected-chromedriver with a residential proxy
import undetected_chromedriver as uc

options = uc.ChromeOptions()
options.add_argument(f"--proxy-server=http://residential:port")

driver = uc.Chrome(options=options, version_main=131)
try:
    driver.get("https://target.com")
    driver.implicitly_wait(5)
    print(driver.page_source[:500])
finally:
    driver.quit()
# Defeats simple webdriver checks. For Cloudflare BM or Kasada, switch frameworks.

Related terms

Concept map

How Selenium connects

The terms most directly tied to this one. Hover a node to see its neighbours, click to preview, drag to rearrange.

0 terms · 0 connections
You are here · Web Scraping APIs
Building map…

Frequently asked questions

Should I learn Selenium in 2026?

For scraping greenfield projects, learn Playwright instead — newer API, fewer detection surfaces, multi-browser without WebDriver. Learn Selenium if you need Safari or mobile testing, or if your team already maintains Selenium tests you can extend.

What's the difference between undetected-chromedriver and SeleniumBase UC mode?

undetected-chromedriver is the underlying library that patches the chromedriver binary and runtime. SeleniumBase UC mode wraps it with a friendlier API, pytest integration, and built-in helpers (Cloudflare auto-click, session reuse). If you want quick stealth in a pytest project, SeleniumBase UC. If you want minimal dependencies, undetected-chromedriver directly.

Can Selenium with stealth defeat Cloudflare?

Bot Fight Mode and Turnstile, usually yes — undetected-chromedriver + a residential proxy passes Turnstile on most sites. Cloudflare Bot Management Enterprise, no. Switch to Camoufox or a managed API.

Last updated: 2026-05-27