explaingit

chromedp/chromedp

13,038GoAudience · developerComplexity · 3/5Setup · moderate

TLDR

chromedp is a Go library that controls a real Chrome browser from code with no extra driver software needed, useful for scraping JavaScript-heavy sites, automated testing, and taking screenshots.

Mindmap

mindmap
  root((chromedp))
    What it does
      Browser automation
      Headless Chrome
      No extra driver
    Use cases
      JS site scraping
      Screenshots
      Form submission
      End-to-end testing
    Tech stack
      Go
      Chrome DevTools Protocol
      Docker headless-shell
    Setup
      Go package install
      Chrome required
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Scrape websites that load content through JavaScript by driving a real Chrome browser in headless mode.

USE CASE 2

Take full-page screenshots of any URL in an automated pipeline without a visible browser window.

USE CASE 3

Write end-to-end browser tests for a web app without setting up a separate WebDriver server.

USE CASE 4

Fill out and submit web forms automatically in a Go script.

Tech stack

GoChromeDockerChrome DevTools Protocol

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Chrome or Chromium installed on the system, or the headless-shell Docker image.

In plain English

chromedp is a Go library for controlling a Chrome or Chromium browser from code, without needing any external driver software. It uses the Chrome DevTools Protocol, the same internal protocol that Chrome uses for its developer tools, to send instructions to the browser and read back results. Developers use chromedp for tasks like automated browser testing, taking full-page screenshots, scraping websites that load content through JavaScript, and filling out and submitting forms. Because it talks directly to Chrome without a separate intermediary, it tends to be faster and simpler to set up than alternatives that require running a WebDriver server. By default, chromedp runs Chrome in headless mode, meaning no browser window is shown. This is useful for servers and automated pipelines where a visible browser is not needed. If you do want to see the browser window, that default can be overridden through a configuration option. For containerized environments, a pre-built Docker image called headless-shell is available that packages a stripped-down headless build of Chrome alongside the library. The library is installed through the standard Go package manager and requires no extra dependencies beyond Chrome itself being available on the system. Documentation and examples are hosted on the Go package reference site, and a separate examples repository demonstrates common tasks like authentication flows, file downloads, and handling dynamic content. chromedp is open source and maintained under the chromedp GitHub organization, which also hosts related tools for generating the protocol API and proxying DevTools connections for debugging.

Copy-paste prompts

Prompt 1
Write a chromedp Go program that opens a JavaScript-rendered page, waits for a CSS selector to appear, and extracts all matching text.
Prompt 2
Use chromedp to take a full-page screenshot of a given URL and save it as a PNG file in Go.
Prompt 3
Write a chromedp script that logs into a website with a username and password form, then scrapes data from the authenticated dashboard.
Prompt 4
How do I run chromedp inside a Docker container using the headless-shell image instead of a locally installed Chrome?
Prompt 5
Write a chromedp test that clicks a button, waits for a modal to appear, and asserts the modal heading text.
Open on GitHub → Explain another repo

← chromedp on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.