What is headless browser automation?
Also called browser automation or a headless browser
Headless browser automation is a real web browser, such as Chrome, run by software with no screen attached. It opens pages, waits for them to load, logs in, clicks and types exactly as a person would, then reads what appears. It is how you collect data from, or do work in, websites that offer no API.
The everyday version: a person at a keyboard, without the person or the keyboard. If someone can do it in a browser, a headless browser can do it at 2am, a thousand times over.
Most websites are built in the browser, not sent to it.
A lot of modern websites send almost nothing when you ask for a page: an empty frame and a script. The script then runs in your browser and fills the page in. A simple program that downloads the page never runs the script, so it sees the empty frame.
A headless browser runs the script, because it is a real browser. It sees the page you see.
What a plain request sees
It downloads the page and never runs the script that fills it.
Loading results…
What a headless browser sees
It runs the page like Chrome on a desk, then reads the finished result.
| Name | Company | Updated |
|---|---|---|
| J. Rivera | Northwind Media | 2 days ago |
| A. Okafor | Halcyon Labs | 5 days ago |
| S. Kim | Fieldwork Studio | 1 week ago |
| L. Moreau | Quarry & Co | 2 weeks ago |
Same address, same moment. The only difference is whether the software runs the page the way a person’s browser would.
What it does while you sleep.
A typical scheduled run, the kind that fills a database overnight.
Collect every record from a site with no API, and keep the database current.
1Opens the site in a browser with no windowA real copy of Chrome, started by software on a server.
2Signs in with the account’s own loginUsing credentials stored securely, never typed into a script.
3Waits for the results to appearIt waits for the table itself, not a guessed number of seconds.
4Clicks through every pageNext, next, next, the way a patient person would, only faster.
5Compares with the last runOnly new and changed records are kept, so a re-run never duplicates anyone.
6Writes the changes to your databaseAnd posts an alert if something looks wrong, such as a page that suddenly returns nothing.
Plain scraper, headless browser, API.
| Plain request scraper | Headless browser | Official API | |
|---|---|---|---|
| Sees content built by scripts | No | Yes | Not needed, it returns the data directly |
| Can sign in and click | Rarely | Yes | Uses keys instead |
| Speed | Fast | Slower, a real browser per page | Fastest |
| Breaks when | The page layout changes | The page layout changes | Rarely, changes are announced |
| Use it when | The page is simple and public | There is no API | There is one |
If a site offers an API, use it. A headless browser is for the very large part of the web that does not.
The parts that stop it breaking.
- Proxy rotation and captcha handling. So a long run is not stopped halfway through by the site’s own defences.
- Waiting for elements, not timers. It moves on when the thing it needs is on the page, however long that takes.
- Change detection with alerts. A run that suddenly finds nothing is treated as a problem, not as a quiet day.
- Writing straight into your database. No CSV in someone’s downloads folder. The records land where the rest of your systems already read from.
The collection engine behind 2.5 million records.
BrokerStaffer’s collection engine
BrokerStaffer needed every agent from three different sources in one place, refreshed on a schedule. We built a collection engine that gathers them and matches each person across sources, so a re-run never creates a duplicate.
The result is one record per agent, whatever the source, in a database BrokerStaffer owns.
Words that turn up next to this one.
Still unclear?
What is headless browser automation?
It is a real web browser, such as Chrome, run by software with no screen. It loads pages, logs in, clicks and types like a person, then reads what appears, which makes it the way to collect data from or work in websites that offer no API.
What is the difference between web scraping and headless browser automation?
Web scraping is the goal: turning information on web pages into structured records. A headless browser is one way to do it, needed when the page is built by scripts, sits behind a login, or needs clicks to reveal the data.
Why not just use the website’s API?
If there is one, you should. A headless browser is for sites that offer no API, or whose API leaves out the data or the action you need.
Why do browser automations break?
Usually because the site changed its layout, or because the automation waited a fixed time instead of waiting for the content. Building it to wait for the content itself, and to alert when a run returns nothing, removes most failures.
Is it legal to automate a website?
It depends on the site’s terms, whether you are signed in, and what the data is, particularly personal data. It is checked per project before anything is built, and we only collect what a client is entitled to use.
Wondering what this would look like on your stack?
Thirty minutes. We will tell you whether it is worth building and what it would take. No deck.
OpsLabs builds custom operational systems for growing companies. This page is part of a plain-English glossary of the terms that appear in our proposals and on this site.