Skip to content

chromedp

A Go library that drives Chrome-style browsers through the DevTools Protocol, without an external driver.

Stars
13.3k
Forks
891
Licence
MIT
Language
Go
Last update
5 days ago
Type
Library

What it is

chromedp is a Go package that lets a program control a web browser: open pages, click, read text, fill forms, take screenshots and print PDFs. It talks to browsers that support the Chrome DevTools Protocol and, according to the README, needs no separate driver program. It is mainly used for automated testing and scraping tasks written in Go.

  • Navigate to a page and read its title or the text of an element
  • Fill out and submit a form, then check the result
  • Take a screenshot of an element or the whole page, or print a page to PDF
  • Intercept, block or mock network requests using the Fetch domain
  • Save a login session and restore it in another browser

Great for

  • Go developers who want to automate or test web pages in code
  • Teams writing browser-based tests in Go with unit-test style tooling
  • Developers who need screenshots, PDFs or network interception from Go programs
  • People who want to script a logged-in browser session and reuse it later

Not ideal for

  • People who do not write Go, since it is a Go package and the README shows only Go code
  • Users who want a point-and-click tool with no programming, because it requires writing code
  • Projects that need a browser automation standard across many languages, since this library is Go-specific
Step-by-step guide: how to use chromedpInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Go 1.25 or newer · A Chrome or Chromium-based browser installed (implied by the protocol; the README does not state the exact requirement)

    Install the package

    go get -u github.com/chromedp/chromedp
  2. 2

    Run it

    • Install the package with go get as shown in the README
    • Create a context with chromedp.NewContext(context.Background()) and defer cancel()
    • Run chromedp.Do with chromedp.Navigate to open a page
    • Call chromedp.Run with chromedp.Title() and print the result
  3. 3

    Get the most out of it

    • Read docs/API.md, which has 27 examples comparing old and new code
    • Use docs/MIGRATION.md to find renamed or removed names when upgrading
    • Run the examples repository programs with go run, for example the tabs or screenshot programs
    • Use the remote package when connecting to a browser that is already running or keeping it open after the program ends
    • Use chromedp.Events to subscribe to page events such as LoadEventFired before triggering them

Downloads

Strengths

  • The README says it needs no external driver and uses only the Go standard library and cdproto
  • Has a large set of examples (43 programs, per the README) covering forms, networking, screenshots and more
  • MIT licensed with a documented API and migration guide

Trade-offs

  • Requires Go 1.25 or newer, and the README describes several JSON and cdproto version combinations that can confuse setup
  • Only browsers that support the Chrome DevTools Protocol are covered, and the README does not list which browsers were tested
  • Latest release v0.21.0 has no binaries, so it is used as a Go module rather than a downloadable app

How it compares

ProjectStarsTypeLevelUpdatedBest for
chromedp (this)13.3kLibraryintermediate5 days agoGo developers who want to automate or test web pages in code
chromeless13.2kLibraryintermediate8.0 years agoDevelopers maintaining existing projects that already use Chromeless
testify26.2kLibrarybeginner18 days agoGo developers who want more readable test assertions than the standard library provides
pytest14.7kLibrarybeginner4 days agoPython developers who want to add automated tests to a project
learn-go-with-tests23.9kLearning resourcebeginner11 days agoDevelopers who are new to Go and want a guided, hands-on tutorial
HackBrowserData14.7kCLIintermediate4 days agoSecurity researchers studying how browsers store local data

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.