
On this page
A headless browser is a real web browser — Chrome, Firefox, or WebKit — that runs without a visible graphical interface, controlled entirely through code. It loads pages, runs JavaScript, applies CSS, and fires events exactly like a normal browser, but instead of drawing pixels to a screen it exposes its state through an automation API. Scrapers, automated tests, and screenshot services all use headless browsers to interact with sites that depend on JavaScript to render 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?
Same binary, same engine — just without the visible window. The newer `--headless=new` mode in Chrome runs the actual Chrome UI process in a way that's nearly indistinguishable from headful on most fingerprinting checks.
Playwright vs. Puppeteer vs. Selenium — which one?
Playwright is the modern default: multi-browser, multi-language, best DX. Puppeteer is Chrome-only but tightly integrated. Selenium is the legacy standard, still dominant in enterprise QA. For new scraping projects, pick Playwright.
Can headless browsers solve CAPTCHAs?
Not on their own — they render the challenge but can't see images or read invisible bot scores. You combine a headless browser with a CAPTCHA solver (or a scraping API that integrates both) to get past the challenge.
Do headless browsers respect robots.txt?
No — robots.txt is a convention for crawlers, not browsers. A headless browser will fetch whatever URL you tell it to. Respecting robots.txt is your responsibility to enforce in the code that drives the browser.
Last updated: 2026-05-28