Prompt
Do I need a headless browser for every page I crawl?
Latest observation
Oct 4, 2026
OpenAI APIWeb search: off
No — you only need a headless browser for pages that require client-side JavaScript to render the content you want.
When you do not need a headless browser
Use plain HTTP fetching (requests, httpx, aiohttp, etc.) if:
- the page’s content is already in the initial HTML response
- you’re just extracting static text, links, metadata, or server-rendered data
- the site provides an API or JSON endpoint you can call directly
When you do need one
Use a headless browser like Playwright or Selenium if:
- content appears only after JavaScript runs
- the page uses infinite scroll, lazy loading, or dynamic filtering
- data is embedded in scripts and only rendered client-side
- you need to click, wait, log in, or interact with the page
Best practice
Most crawlers use a hybrid approach:
- Try a fast HTTP fetch first
- Detect whether the page is JS-heavy or content is missing
- Fall back to a headless browser only when needed
This is much faster and cheaper than using a browser for every page.
Rule of thumb
If you can get the data from the raw HTML, don’t use a headless browser.
If you want, I can also show you:
- how to detect when a page needs rendering
- a crawler architecture that mixes HTTP + browser efficiently
Brands