GTM Engineering term, data and enrichment

Headless Browser

A headless browser is a real web browser that runs without a visible window and is controlled by code, so it can load, read and interact with pages automatically.

Also called: headless Chrome, browser automation, Puppeteer, Playwright

Headless Browser lives in reach, the part of the funnel about reaching buyers, near related terms like Web Scraping, AI Agent and Company Research (the blue squares).

A headless browser is a real web browser that runs without a visible window and is controlled by code, so it can load, read and interact with pages automatically. It sees pages the way a human visitor does, scripts and all. GTM teams use it for web scraping of modern sites, for screenshots and for giving AI agents the ability to browse.

How it works

Under the hood it is the same engine as desktop Chrome, Firefox or Safari. A library like Playwright or Puppeteer starts it, opens a page, and sends commands:

  1. Navigate to a URL and wait for the network or a specific element to load.
  2. Interact if needed: click a tab, scroll to trigger lazy loading, fill a search box.
  3. Extract the rendered HTML, text, or specific elements, or take a screenshot.
  4. Close the page so memory does not pile up.

Because each session runs a full browser, it costs real CPU and memory. Teams run them in containers, in a serverless function with a slim browser build, or through a hosted browser service that handles scaling and proxies.

The newer use is agentic. An AI agent with browsing as a tool (see tool use) drives a headless browser to search, open pages and read them, then writes a structured answer. That is how many AI-driven company research workflows actually see the web.

Example

Say a team wants to check 5,000 SaaS company sites weekly for whether the pricing page shows a free plan. Assumptions for the example:

  • A plain HTTP fetch takes 0.3 seconds but returns content on only 55% of sites, because the rest render pricing with JavaScript.
  • A headless browser takes 4 seconds per page and returns content on 92%.

Plain fetch only: 2,750 usable checks, about 25 minutes of total fetch time. Headless only: 4,600 usable checks, about 5.5 hours of fetch time, or roughly 20 minutes when run 16 sessions in parallel.

The best design does both. Try the cheap fetch first and fall back to headless only for the 45% that came back empty. That is about 2,250 headless runs, which keeps compute near half while still reaching 92% coverage.

When it matters and when it doesn't

Use a headless browser when content renders client side, when you need to click or scroll to reveal data, when you need a screenshot, or when an agent needs to browse like a person.

Skip it when the site has an API, when the data is in the raw HTML, or when a sitemap or RSS feed already exposes what you need. Also respect site terms: running a browser does not make collection permitted, and logged-in automation on platforms that forbid it can get accounts banned.

Build error handling in from day one. Pages time out, cookie banners block content and layouts change without warning.

Common mistakes

  • Defaulting to headless for every page and paying ten times the compute for no gain.
  • Not closing pages and sessions, so memory leaks crash long runs.
  • Waiting a fixed number of seconds instead of waiting for the element you need.
  • Ignoring cookie consent overlays that hide the content you are trying to read.
  • Running thousands of parallel sessions from one IP and getting blocked.

FAQ

Why use a headless browser instead of a simple HTTP request?

Many modern sites build their content with JavaScript after the page loads, so a plain request only returns an empty shell. A headless browser runs that JavaScript like a real visitor, so you see the same content a person would.

What are the most common headless browser tools?

Developers commonly use Playwright and Puppeteer to control headless Chrome, Firefox or WebKit. Hosted browser services run fleets of these in the cloud so you do not manage servers, and many AI agent frameworks use one under the hood.

Are headless browsers slow or expensive?

They are much heavier than a plain request because each one loads a full page with scripts, images and styles. Expect seconds per page rather than milliseconds, so use them only for pages that need rendering or interaction.

See all data and enrichment terms ↳

Used in these articles