MCPcopy
hub / github.com/go-rod/rod

github.com/go-rod/rod @v0.116.2 sqlite

repository ↗ · DeepWiki ↗ · release v0.116.2 ↗
5,158 symbols 16,034 edges 190 files 3,753 documented · 73%
README

Overview

Go Reference Discord Chat

Documentation | API reference | FAQ

Rod is a high-level driver directly based on DevTools Protocol. It's designed for web automation and scraping for both high-level and low-level use, senior developers can use the low-level packages and functions to easily customize or build up their own version of Rod, the high-level functions are just examples to build a default version of Rod.

中文 API 文档

Features

  • Chained context design, intuitive to timeout or cancel the long-running task
  • Auto-wait elements to be ready
  • Debugging friendly, auto input tracing, remote monitoring headless browser
  • Thread-safe for all operations
  • Automatically find or download browser
  • High-level helpers like WaitStable, WaitRequestIdle, HijackRequests, WaitDownload, etc
  • Two-step WaitEvent design, never miss an event (how it works)
  • Correctly handles nested iframes or shadow DOMs
  • No zombie browser process after the crash (how it works)
  • CI enforced 100% test coverage

Examples

Please check the examples_test.go file first, then check the examples folder.

For more detailed examples, please search the unit tests. Such as the usage of method HandleAuth, you can search all the *_test.go files that contain HandleAuth, for example, use Github online search in repository. You can also search the GitHub issues or discussions, a lot of usage examples are recorded there.

Here is a comparison of the examples between rod and Chromedp.

If you have questions, please raise an issues/discussions or join the chat room.

Join us

Your help is more than welcome! Even just open an issue to ask a question may greatly help others.

Please read How To Ask Questions The Smart Way before you ask questions.

We use Github Projects to manage tasks, you can see the priority and progress of the issues here.

If you want to contribute please read the Contributor Guide.

Extension points exported contracts — how you extend this code

Client (Interface)
Client interface to send the request. So that this lib doesn't handle anything has side effect. [601 implementers]
lib/proto/a_interface.go
CDPClient (Interface)
CDPClient is usually used to make rod side-effect free. Such as proxy all IO of rod. [4 implementers]
utils.go
WebSocketable (Interface)
WebSocketable enables you to choose the websocket lib you want to use. Such as you can easily wrap gorilla/websocket and [3 …
lib/cdp/client.go
ImgProcessor (Interface)
ImgProcessor is the interface for image processing. [2 implementers]
lib/utils/imageutil.go
Host (FuncType)
Host formats a revision number to a downloadable URL for the browser.
lib/launcher/browser.go
Call (FuncType)
(no doc)
setup_test.go
Request (Interface)
Request represents a cdp.Request.Method. [595 implementers]
lib/proto/a_interface.go
Dialer (Interface)
Dialer interface for WebSocket connection. [1 implementers]
lib/cdp/utils.go

Core symbols most depended-on inside this repo

Call
called by 626
lib/proto/a_interface.go
call
called by 595
lib/proto/a_interface.go
MustElement
called by 204
must.go
MustNavigate
called by 186
must.go
Call
called by 125
utils.go
Err
called by 118
lib/launcher/url_parser.go
AddKey
called by 105
lib/input/keyboard.go
Get
called by 99
lib/launcher/browser.go

Shape

Method 2,853
Struct 1,416
Function 588
TypeAlias 283
Interface 10
FuncType 6
Class 2

Languages

Go99%
TypeScript1%

Modules by API surface

lib/proto/definitions_test.go788 symbols
lib/proto/page.go322 symbols
lib/proto/network.go255 symbols
lib/proto/dom.go231 symbols
lib/proto/storage.go180 symbols
lib/proto/css.go166 symbols
must.go164 symbols
lib/proto/debugger.go142 symbols
lib/proto/runtime.go128 symbols
lib/proto/emulation.go126 symbols
lib/proto/overlay.go119 symbols
lib/proto/target.go80 symbols

Dependencies from manifests, versioned

github.com/gobwas/httpheadv0.1.0 · 1×
github.com/gobwas/poolv0.2.1 · 1×
github.com/gobwas/wsv1.1.0 · 1×
github.com/ysmood/fetchupv0.2.3 · 1×
github.com/ysmood/goobv0.4.0 · 1×
github.com/ysmood/gopv0.2.0 · 1×
github.com/ysmood/gotv0.40.0 · 1×
github.com/ysmood/gotracev0.6.0 · 1×
github.com/ysmood/gsonv0.7.3 · 1×
github.com/ysmood/leaklessv0.9.0 · 1×
golang.org/x/sysv0.0.0-2020120722354 · 1×

For agents

$ claude mcp add rod \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact