Headless browsers explained: what they are and when to use one
By the ProxyOnly team · 25 Nov 2026 · 5 min read
A headless browser is a real browser without a window. What it does for scraping and testing, what it costs in speed, and when plain HTTP is better.
A headless browser is a real browser running without a visible window. Same engine, same JavaScript, same rendering, no interface. You drive it from code instead of with a mouse.
That is the whole concept. The interesting questions are what it buys you and what it costs, because the cost is higher than most people expect.
What it actually does differently
A plain HTTP request fetches one file and stops. You get the HTML the server sent, and nothing else happens.
A browser does considerably more with that same HTML. It parses it, requests every stylesheet, script, image and font referenced in it, builds a DOM, executes the JavaScript, lets that JavaScript modify the DOM and fetch more data, applies CSS, and produces a rendered page. It also keeps cookies, storage and a session.
So the difference is not that one is heavier. It is that a browser runs the site's code, and a plain request does not. If the content you want is written into the page by JavaScript after load, a plain request cannot see it, because the step that would have created it never ran.
Headless, and the versions of it
Chrome's headless mode was rewritten. The old implementation was a separate binary that behaved differently from real Chrome in ways sites learned to detect. The current one, selected with --headless=new in older releases and the default in recent ones, is the same browser with the window suppressed. Chrome's team documented the change when it shipped.
This matters if you are reading older tutorials. Advice about headless Chrome being detectable often predates the rewrite and describes a binary that is no longer what you are running.
Firefox has -headless, and WebKit has its own equivalent used through Playwright.
Check this before you reach for one
Most scraping jobs that people solve with a headless browser do not need one. The check takes a minute and often saves an order of magnitude in cost.
Open the page in a normal browser, open developer tools, go to the Network tab, filter to Fetch/XHR, and reload. Look at what comes back. On a very large number of modern sites the page itself is a shell, and the data arrives separately as JSON from an API endpoint.
If you find that endpoint, call it directly. You get structured JSON instead of HTML you have to parse, it is faster by a wide margin, it uses a fraction of the resources, and it breaks less often, because an internal API changes shape less frequently than a page layout does.
The second check: fetch the page with curl and search the output for a string you can see on screen. If it is there, the HTML already contains your data and a browser adds nothing.
curl -s https://quotes.toscrape.com/ | grep -c "class=\"quote\""We ran that and it printed 10. The quotes are in the HTML, so a plain requests script handles that site completely, and a browser would be pure overhead.
When a headless browser earns its cost
The content genuinely is not in the HTML and there is no clean API to call, or the API requires a token that only the page's own JavaScript can produce.
The flow requires interaction: logging in, clicking through steps, scrolling to trigger loading more, dismissing something.
You are testing, not scraping. This is what headless browsers were built for. Running a test suite against a real browser engine, taking screenshots to compare, checking layout at different viewport sizes.
You need the rendered result itself: a screenshot, or a PDF.
What it costs
Be concrete about this, because it is the part that surprises people at scale.
A plain HTTP request costs one connection and a few kilobytes of memory. A browser page costs a process, typically 100 to 300 MB of memory, plus CPU for parsing, JavaScript execution and rendering, plus the bandwidth of every asset on the page rather than just the HTML.
In practice that is one to two orders of magnitude more resource per page. A crawl of 100,000 pages that is routine with requests becomes a serious infrastructure project with a browser.
There is also a maintenance cost. Browsers update, drivers go out of step, and a headless setup that works today needs attention in a way a requests script does not.
The detection question, honestly
Sites that want to tell automated browsers from human ones have many signals: the navigator.webdriver property, missing or unusual plugin and font lists, canvas and WebGL rendering differences, TLS and HTTP/2 fingerprints, and above all behaviour, because humans move the mouse and pause unevenly and scripts do not.
Expect this to be an ongoing cost rather than a problem you solve once. Our post on browser fingerprinting covers the signals in detail, and why websites block IPs and proxies covers what blocking usually keys on, which is more often request rate than anything clever.
Worth saying plainly: if a site has gone to real effort to keep automated clients out, that is a decision by its operator. Read the terms, check whether an official API exists, and consider that paying for the API is frequently cheaper than the engineering time of fighting the website. Is web scraping legal covers the rules in more detail.
Headed, headless, and the middle ground
Two options sit between a full browser and a plain request, and both are underused.
Run the browser headed but off-screen. During development, watching the browser do the thing is far faster to debug than reading logs about why a selector did not match. Most frameworks let you flip one flag. Develop headed, deploy headless.
Use the browser once, then leave it. A common and effective pattern is to drive a browser only through the part that genuinely needs it, usually a login, then take the resulting cookies and continue with plain HTTP requests. You pay the browser cost once per session instead of once per page, which on a long crawl is the difference between affordable and not.
cookies = {c["name"]: c["value"] for c in page.context.cookies()}
r = requests.get(url, cookies=cookies, timeout=10)Choosing a tool
Playwright drives Chromium, Firefox and WebKit from one API, in Python, Node, Java and .NET, and has the best waiting behaviour of the three.
Puppeteer is Node and Chrome-focused, maintained by the Chrome team, and the lightest choice if Chrome alone is enough.
Selenium is the oldest, supports the widest range of languages and browsers, and is the standard in established testing setups.
Playwright vs Selenium vs Puppeteer compares them properly, and browser automation behind a proxy covers routing any of them through a proxy, which has its own traps around authentication.
Try it yourself
Create an account, add funds from US$1 and order a proxy in the country you need.
Keep reading
25 Nov 2026 · Web scraping
Web scraping API vs proxies vs building it yourself
Scraping API, raw proxies, or your own stack. What each actually costs, what you give up, and the cases where we would tell you to buy the API instead.
25 Nov 2026 · Web scraping
Python web scraping tutorial: from first request to a polite crawler
A working Python scraper built in stages: one request, parsing, following pagination, error handling, and the manners that keep a crawler running.