What is chromedp?
chromedp is a Go package that drives browsers speaking the Chrome DevTools Protocol, such as Chrome and Chromium, with no external driver: no Node.js, Selenium or WebDriver process sits between your program and the browser. It sits in the Web Scraping & Crawling category of the Data & Labeling tools and is open-source, written in Go and licensed MIT.
Overview
chromedp is a Go package that drives browsers speaking the Chrome DevTools Protocol, such as Chrome and Chromium, with no external driver: no Node.js, Selenium or WebDriver process sits between your program and the browser. It covers the usual browser-automation jobs — navigating pages, reading text, filling and submitting forms, running JavaScript, intercepting requests, taking screenshots and printing PDFs — from ordinary Go code. The module depends only on the Go standard library and chromedp's generated protocol package, cdproto.
The programming model is built around actions. An action is a function that runs against a browser tab; chromedp.Do runs actions that return nothing and chromedp.Run runs one action and returns its value, so reading a page title is a single call. Page events are Go iterators: chromedp.Events subscribes when it returns, so a program can subscribe, trigger the event and then range over it without missing it. Each context made with chromedp.NewContext holds a browser and a tab, and child contexts open new tabs in the same browser that are safe to use from separate goroutines.
By default chromedp starts Chrome headless and talks to it through a pipe (Chrome's --remote-debugging-pipe), so no debugging port is opened. The bundled remote package adds a websocket client for attaching to a browser that is already running, such as a container or a hosted service, and for keeping a browser open after the program exits. A visible window is one option (WithVisibleWindow, or CHROMEDP_VISIBLEWINDOW=1), and the companion termcast module streams the screen of a headless page into a terminal that can show images, even over ssh.
The project dates from 2017, when it was presented at GopherCon Singapore as a new way to drive the web from Go. Version v0.20.0 introduced the generic, iterator-based API built on typed cdproto, and the README links a migration guide listing every renamed and removed name. The companion chromedp/examples repository holds 46 single-file programs for larger tasks, and the chromedp/headless-shell Docker image provides a smaller headless build of Chrome that chromedp finds by default. It is MIT-licensed.

What it does
- Pure Go client for the Chrome DevTools Protocol — no Node, Selenium or WebDriver, only the standard library plus cdproto
- Action-based API: chromedp.Do for side effects, chromedp.Run to return a value, chromedp.Call for any raw protocol command
- Page events as Go iterators that subscribe before you trigger them, so no event is missed
- Headless by default over a pipe; optional websocket, remote attach and keep-open via the remote package
- Tabs as contexts: child contexts open parallel tabs in one browser, safe across goroutines
- Screenshots, PDF printing, device emulation, request interception, cookies, downloads and HAR capture, each shown in the examples repository
- WithRuntimeDisabled attaches without enabling the Runtime domain, running queries in an isolated world of each frame
Getting started
chromedp is a normal Go module; it needs Go 1.25 or newer and a Chrome or Chromium install (or the chromedp/headless-shell image). The steps below follow the project README.
Add the module
go get -u github.com/chromedp/chromedpOpen a page and read its title
NewContext creates a browser context; the first action starts Chrome. Do runs actions that return nothing, Run returns a value.
ctx, cancel := chromedp.NewContext(context.Background())
defer cancel()
if err := chromedp.Do(ctx, chromedp.Navigate(`https://pkg.go.dev/`)); err != nil {
log.Fatal(err)
}
title, err := chromedp.Run(ctx, chromedp.Title())
if err != nil {
log.Fatal(err)
}
fmt.Println(title)Wait for a page event
Events subscribes as soon as it returns, so you can subscribe, navigate, then read the event from the iterator.
loaded := chromedp.Events(ctx, page.LoadEventFired)
if err := chromedp.Do(ctx, chromedp.Navigate(`https://pkg.go.dev/`)); err != nil {
log.Fatal(err)
}
for ev, err := range loaded {
if err != nil {
log.Fatal(err)
}
fmt.Println(ev.Timestamp)
break
}Attach to a browser that is already running
For a container or hosted browser, point the remote allocator at its websocket address and build contexts from it.
allocCtx, cancel := remote.NewAllocator(context.Background(), "ws://127.0.0.1:9222/")
defer cancel()
ctx, cancel := chromedp.NewContext(allocCtx)
defer cancel()
title, err := chromedp.Run(ctx, chromedp.Title())Run a bigger example
Each program in chromedp/examples is one main.go; add -visible to show the browser window or -v to print the protocol messages.
go run github.com/chromedp/examples/tabs@latestCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Scraping pages that only render in a real browser, from a Go service with no Node or Selenium dependency
- Generating screenshots and PDFs of web pages in a Go backend or a headless-shell container
- End-to-end tests and form automation written in Go, with request interception and cookie control
- Giving a Go-based agent or crawler a scriptable browser, locally or attached to a remote Chrome
How chromedp compares
chromedp alongside other open-source web scraping & crawling tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Firecrawl | ★ 214k | A crawling service and API that converts whole websites into clean Markdown or structured JSON ready for LLMs. |
| Agent Reach | ★ 116k | A capability layer that installs, health-checks and routes readers so a CLI agent can read and search web pages, YouTube, RSS, GitHub, Reddit, Twitter/X and more without API fees. |
| Scrapling | ★ 107k | A Python web scraping framework whose parser relocates your elements when pages change, with stealthy fetchers and a Scrapy-like spider engine for full crawls. |
| Crawl4AI | ★ 88.2k | A local-first Python web crawler that turns pages into clean Markdown for use in RAG and LLM pipelines. |
| Scrapy | ★ 65.7k | A mature Python framework for writing fast spiders that crawl websites and extract structured data at scale. |
| changedetection.io | ★ 36.1k | A self-hosted web page change monitor with XPath/CSS/jq filters, browser steps and restock alerts, which can route every diff through an LLM to suppress noise. |
| ScrapeGraphAI | ★ 33k | A Python library that uses LLMs and a graph pipeline to extract data from pages based on natural-language prompts. |
| chromedp | ★ 13.4k | Drive Chrome from Go over the DevTools Protocol, with no external driver |
