What is a headless browser?
A browser without a window, like Chrome run by Puppeteer or Playwright. It loads the page, runs its JavaScript and lets a script read the result. Useful for testing and for pages that are built in the browser. Costly when all you want is one value from the HTML.
Do you need one? Check in a minute
View source, not inspect. Open view-source: and search for the price. If it is there, a plain HTTP request gets it.
Look for JSON in the page. JSON-LD, __NEXT_DATA__ or a state blob often carries every field, ready to read.
Look at the network tab. If the page loads its data from a JSON URL, that may be easier to read than the page (check the terms).
Only then a browser. Values that truly appear only after JavaScript, or behind a click: that is what a headless browser is for.
Headless browser alternatives
A plain request plus rules that read the HTML. Same answer, a fraction of the time and memory, and no browser to keep up to date. Reading 1 million pages:
| Setup | Per page | 1 million pages |
|---|---|---|
| A large AI model on raw HTML | 1 cent a page and up | €10,000+ a run |
| A small AI model on trimmed HTML | 0.05 to 0.5 cent a page | €500 – €5,000 a run |
| A headless browser | seconds and hundreds of MB a page | servers that grow with the crawl |
| An extraction script | €0 a page, under 1 ms | €78 once (5 fields) |