OpsLabs Book a call
In plain English›Headless browser automation

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.

The problem it solves

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.

The same page, fetched two waysswitch between them

What a plain request sees

It downloads the page and never runs the script that fills it.

directory.example/results

Loading results…

0records found. The page’s script never ran.

Same address, same moment. The only difference is whether the software runs the page the way a person’s browser would.

One run, start to finish

What it does while you sleep.

A typical scheduled run, the kind that fills a database overnight.

The job

Collect every record from a site with no API, and keep the database current.

  1. 1Opens the site in a browser with no window

    A real copy of Chrome, started by software on a server.

  2. 2Signs in with the account’s own login

    Using credentials stored securely, never typed into a script.

  3. 3Waits for the results to appear

    It waits for the table itself, not a guessed number of seconds.

  4. 4Clicks through every page

    Next, next, next, the way a patient person would, only faster.

  5. 5Compares with the last run

    Only new and changed records are kept, so a re-run never duplicates anyone.

  6. 6Writes the changes to your database

    And posts an alert if something looks wrong, such as a page that suddenly returns nothing.

Waiting for the thing itself, rather than for a fixed time, is most of the difference between a scraper that works and one that breaks every week.
The words people mix up

Plain scraper, headless browser, API.

 Plain request scraperHeadless browserOfficial API
Sees content built by scriptsNoYesNot needed, it returns the data directly
Can sign in and clickRarelyYesUses keys instead
SpeedFastSlower, a real browser per pageFastest
Breaks whenThe page layout changesThe page layout changesRarely, changes are announced
Use it whenThe page is simple and publicThere is no APIThere 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.

What makes it reliable

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.
What we built with it

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.

2.5Magent records, built for
3sources matched into one record
0duplicates when it runs again
Read the BrokerStaffer case study
Related terms

Words that turn up next to this one.

Common questions

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.

Working together

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.

Book a 30-minute call

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.