█

AI/TLDR

Buy me a coffee
Buy me a coffee

Rod

Drive Chrome from Go over the DevTools Protocol, with auto-waiting built in

Web Scraping & CrawlingOpen source
Language
Go
License
MIT
$go get github.com/go-rod/rod
IN SHORT

What is Rod?

Rod is a high-level Go driver built directly on the Chrome DevTools Protocol, designed for web automation and scraping. It sits in the Web Scraping & Crawling category of the Data & Labeling tools and is open-source, written in Go and licensed MIT. To get started: add the module.

Overview

Rod is a high-level Go driver built directly on the Chrome DevTools Protocol, designed for web automation and scraping. It is deliberately two-layered: the low-level packages expose the protocol itself so you can build your own driver on top, and the high-level helpers are presented as one convenient assembly of those pieces rather than a closed framework. If you want a different set of ergonomics, you compose your own from the same parts.

The design decisions are aimed squarely at the failure modes of browser automation. Elements auto-wait to be ready, so you are not sprinkling sleeps through a scraper. The chained context design makes timing out or cancelling a long-running task natural. All operations are thread-safe. A two-step WaitEvent design means you never miss an event that fires between subscribing and acting. Nested iframes and shadow DOMs are handled correctly. And the browser process does not survive a crash of your program — Rod uses the leakless helper so there are no zombie Chrome processes left behind.

Practical helpers cover the things scrapers actually need: WaitStable for a page that has settled, WaitRequestIdle for network quiet, HijackRequests for intercepting and rewriting traffic, and WaitDownload for file downloads. Rod finds an installed browser or downloads one automatically through lib/launcher, and it is debugging-friendly, with automatic input tracing and remote monitoring of a headless browser so you can watch what your script is doing.

The project enforces 100% test coverage in CI, and the test suite doubles as the documentation: the README points you at examples_test.go first, then the lib/examples folder, and suggests searching the *_test.go files for any method you want a usage sample of. A side-by-side comparison with Chromedp lives in lib/examples/compare-chromedp. Rod is MIT-licensed, with API reference on pkg.go.dev and a Chinese API translation at go-rod/go-rod-chinese.

What it does

  • High-level Go API directly over the Chrome DevTools Protocol, with the low-level packages exposed for custom drivers
  • Auto-waiting elements and a chained context design for clean timeouts and cancellation
  • Helpers for real-world scraping: WaitStable, WaitRequestIdle, HijackRequests, WaitDownload
  • Two-step WaitEvent design so events firing during subscription are never missed
  • Correct handling of nested iframes and shadow DOMs
  • Automatically finds or downloads a browser via lib/launcher; no zombie process after a crash
  • Thread-safe across all operations, with input tracing and remote headless monitoring for debugging
  • Queries by CSS selector, XPath and regex

Getting started

Rod is a normal Go module. The README's own entry point is examples_test.go — start there, then lib/examples, then search the unit tests for the method you need.

Add the module

bashbash
go get github.com/go-rod/rod

Open a page and read an element

From the repository's Example_basic: launch a browser, open GitHub, type into the search box and pull text out of the result. Rod finds or downloads a browser for you.

gogo
package main

import (
	"fmt"

	"github.com/go-rod/rod"
	"github.com/go-rod/rod/lib/input"
)

func main() {
	browser := rod.New().MustConnect()
	defer browser.MustClose()

	page := browser.MustPage("https://github.com").MustWaitStable()

	page.Keyboard.MustType(input.Slash)
	page.MustElement("#query-builder-test").MustInput("git").MustType(input.Enter)

	text := page.MustElementR("span", "most widely used").MustText()
	fmt.Println(text)
}

Evaluate JavaScript

MustEval runs a JS function on the page; arguments are passed as JSON. Evaluated on an element, `this` is that DOM node.

gogo
page.MustEval(`() => console.log("hello world")`)

fmt.Println("1 + 2 =", page.MustEval(`(a, b) => a + b`, 1, 2).Int())

fmt.Println(page.MustElement("title").MustEval(`() => this.innerText`).Str())

Find more usage

Check examples_test.go and lib/examples, then search the repository's *_test.go files for a method — e.g. HandleAuth — to find a worked example. The comparison with Chromedp is in lib/examples/compare-chromedp.

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Scraping sites that only render under a real browser, from Go services
  • Intercepting and rewriting network requests mid-page with HijackRequests
  • End-to-end browser testing where flaky waits are the main source of failures
  • Building a custom automation driver on the low-level CDP packages instead of accepting a framework's defaults

How Rod compares

Rod alongside other open-source web scraping & crawling tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Firecrawl★ 214kA crawling service and API that converts whole websites into clean Markdown or structured JSON ready for LLMs.
Agent Reach★ 116kA 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★ 107kA 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.2kA local-first Python web crawler that turns pages into clean Markdown for use in RAG and LLM pipelines.
Scrapy★ 65.7kA mature Python framework for writing fast spiders that crawl websites and extract structured data at scale.
changedetection.io★ 36.1kA 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★ 33kA Python library that uses LLMs and a graph pipeline to extract data from pages based on natural-language prompts.
Rod★ 7.2kDrive Chrome from Go over the DevTools Protocol, with auto-waiting built in