browser

Headless Chrome

Headless Chrome runs the Chrome browser without a graphical user interface, enabling automated page rendering, JavaScript execution, and screenshot capture from a server.

Chrome's `--headless` flag launches the browser without rendering to a screen, consuming far less memory and CPU than a full graphical session. Headless Chrome exposes the Chrome DevTools Protocol (CDP), which allows external programs to control page navigation, inspect the DOM, intercept network requests, execute JavaScript, and capture screenshots.

Playwright and Puppeteer are the dominant libraries for controlling headless Chrome programmatically. They wrap CDP in a high-level API and handle browser lifecycle management, page context isolation, and event waiting. Some libraries (Playwright) can also drive Firefox and WebKit in headless mode.

Detection of headless Chrome is a cat-and-mouse game: anti-bot systems look for tells such as missing `window.chrome` properties, specific navigator attributes set by headless mode, or WebGL rendering differences. Stealth patches (puppeteer-extra-plugin-stealth, Playwright's maskFingerprintingScripts) override these properties to make the headless browser indistinguishable from a real user's Chrome.

Examples

# Launch headless Chrome via Playwright CLI
playwright codegen https://example.com
# Or programmatically:
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True)
    page = browser.new_page()
    page.goto("https://example.com")
    print(page.title())
    browser.close()

Related Terms

Extract Headless Chrome data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

View API docs

Your first scrape.
Sixty seconds.

$1 free balance. No credit card. No SDK.Just a POST request.

terminal
curl -X POST https://api.alterlab.io/v1/scrape \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "formats": ["markdown"]}'

No credit card required · Up to 5,000 free scrapes · Balance never expires

    Headless Chrome — Web Scraping Glossary | AlterLab