
On this page
A headless browser is a real web browser — Chrome, Firefox, or WebKit — that runs without a visible window, driven entirely by code instead of by a person clicking. It still loads pages, runs JavaScript, applies CSS, and fires events exactly like the browser on your screen — it just doesn't draw anything for a human to look at. Instead, it exposes what it's doing through an automation API your program can call. Scrapers, automated tests, and screenshot services all rely on headless browsers to work with sites that need JavaScript to build their content.
Quick facts
| Common implementations | Headless Chrome, Headless Firefox, WebKit (Safari engine) |
|---|---|
| Automation libraries | Playwright, Puppeteer, Selenium |
| Primary use cases | Scraping JS-heavy sites, automated testing, PDF/screenshot generation |
| Tradeoff vs. HTTP | 5–50x slower and more memory-hungry, but renders pages a request library can't |
Code example
from playwright.sync_api import sync_playwright
# Launch Chromium with no visible UI, render a JS-heavy page,
# then read the DOM after scripts have run.
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
page.goto('https://example.com/dashboard')
page.wait_for_selector('.loaded')
html = page.content()
browser.close()Related terms
Concept map
How Headless Browser connects
The terms most directly tied to this one. Hover a node to see its neighbours, click to preview, drag to rearrange.
Frequently asked questions
Is headless Chrome the same as regular Chrome?
Yes — same program, same engine, just without the visible window. The newer `--headless=new` mode runs the actual Chrome UI process in a way that's nearly indistinguishable from regular (headful) Chrome on most fingerprinting checks.
Playwright vs. Puppeteer vs. Selenium — which one?
Playwright is the modern default: it drives multiple browsers, works in several languages, and has the best developer experience. Puppeteer is Chrome-only but tightly integrated. Selenium is the older standard, still dominant in enterprise QA teams. For a new scraping project, pick Playwright.
Can headless browsers solve CAPTCHAs?
Not by themselves — a headless browser can display the challenge, but it can't recognize images or read the invisible bot scores a CAPTCHA uses to judge you. On sites you are permitted to access, the durable approach is to reduce how often a challenge appears in the first place — a coherent fingerprint and quality residential IPs — rather than relying on the headless browser to clear it.
Do headless browsers respect robots.txt?
No. robots.txt is a polite convention aimed at crawlers, not browsers, so a headless browser will fetch any URL you point it at. Honoring robots.txt is up to you to build into the code that drives the browser.
Last updated: 2026-05-31