Versions in this module Expand all Collapse all v0 v0.1.0 Oct 10, 2026 Changes in this version + const Version + const ZendriverVersion + var ErrClosed = errors.New("dgodriver: connection closed") + var ErrNotFound = errors.New("dgodriver: element not found") + func Circle(x, y, radius float64, num int, clockwise bool) [][2]float64 + func CompareTargetInfo(a, b cdp.TargetTargetInfo) map[string][2]any + func FilterNodes(root cdp.DOMNode, predicate func(cdp.DOMNode) bool) []cdp.DOMNode + func FindExecutable(browser string) (string, error) + func FlattenFrameTree(tree cdp.PageFrameTree) []cdp.PageFrameTree + func MergeDisableFeaturesArgs(args []string) []string + func Sleep(ctx context.Context, duration time.Duration) error + func WalkNodes(root cdp.DOMNode, fn func(cdp.DOMNode)) + type Browser struct + Config Config + Info BrowserInfo + func Connect(ctx context.Context, websocketURL string) (*Browser, error) + func Start(ctx context.Context, configs ...Config) (_ *Browser, err error) + func (b *Browser) Close() error + func (b *Browser) Contexts() []*BrowserContext + func (b *Browser) Cookies() *CookieJar + func (b *Browser) CreateContext(ctx context.Context, options ...ContextOptions) (*BrowserContext, error) + func (b *Browser) Get(ctx context.Context, url string, options ...NavigationOptions) (*Tab, error) + func (b *Browser) GetTab(ctx context.Context, text string) (*Tab, error) + func (b *Browser) GrantAllPermissions(ctx context.Context) error + func (b *Browser) GrantPermissions(ctx context.Context, permissions []cdp.BrowserPermissionType, origin string, ...) error + func (b *Browser) HTTPGet(ctx context.Context, endpoint string, out any) error + func (b *Browser) MainTab() *Tab + func (b *Browser) NewTab(ctx context.Context, url string, newWindow ...bool) (*Tab, error) + func (b *Browser) Sleep(ctx context.Context, d time.Duration) error + func (b *Browser) Stop(ctx context.Context) error + func (b *Browser) Stopped() bool + func (b *Browser) Tab(ctx context.Context, id string) (*Tab, error) + func (b *Browser) Tabs() []*Tab + func (b *Browser) Targets() []*Tab + func (b *Browser) TestConnection(ctx context.Context) error + func (b *Browser) TileWindows(ctx context.Context, width, height, columns int) ([]WindowBounds, error) + func (b *Browser) UpdateTargets(ctx context.Context) error + func (b *Browser) WebSocketURL() string + type BrowserContext struct + Browser *Browser + ID string + func (bc *BrowserContext) Close() error + func (bc *BrowserContext) Cookies() *CookieJar + func (bc *BrowserContext) Dispose(ctx context.Context) error + func (bc *BrowserContext) NewTab(ctx context.Context, url string, newWindow ...bool) (*Tab, error) + type BrowserInfo struct + Browser string + ProtocolVersion string + UserAgent string + WebSocketDebuggerURL string + type CloudflareChallenge struct + Host *Element + IFrame *Element + ShadowRoot *Element + type CloudflareOptions struct + ChallengeSelector string + ClickDelay time.Duration + FlashCorners bool + Timeout time.Duration + type Config struct + Browser string + BrowserArgs []string + BrowserExecutablePath string + DisableWebGL bool + EnableWebRTC bool + Expert bool + Extensions []string + HTTPTimeout time.Duration + Headless bool + Host string + Lang string + NoSandbox bool + Port int + StartupTimeout time.Duration + UserAgent string + UserDataDir string + WebSocketURL string + func (c *Config) AddArgument(arg string) error + func (c *Config) AddExtension(path string) error + func (c Config) Arguments() []string + type Connection struct + func Dial(ctx context.Context, websocketURL string) (*Connection, error) + func (c *Connection) AddHandler(ctx context.Context, method string, fn func(Event)) *Subscription + func (c *Connection) Call(ctx context.Context, method string, params any) (json.RawMessage, error) + func (c *Connection) Close() error + func (c *Connection) Closed() bool + func (c *Connection) Disable(ctx context.Context, domain string) error + func (c *Connection) Done() <-chan struct{} + func (c *Connection) Enable(ctx context.Context, domain string) error + func (c *Connection) On(ctx context.Context, method string, fn func(Event)) (*Subscription, error) + func (c *Connection) RemoveHandlers(method string) + func (c *Connection) Send(ctx context.Context, method string, params, out any) error + func (c *Connection) SessionID() string + func (c *Connection) Wait(ctx context.Context, idle time.Duration) error + type ContextOptions struct + KeepOnDetach bool + OriginsWithUniversalNetworkAccess []string + ProxyBypassList string + ProxyServer string + ProxyTLSConfig *tls.Config + type CookieJar struct + func (j *CookieJar) Clear(ctx context.Context) error + func (j *CookieJar) GetAll(ctx context.Context) ([]cdp.NetworkCookie, error) + func (j *CookieJar) HTTPCookies(ctx context.Context) ([]*http.Cookie, error) + func (j *CookieJar) Load(ctx context.Context, path string, pattern ...string) error + func (j *CookieJar) Save(ctx context.Context, path string, pattern ...string) error + func (j *CookieJar) SetAll(ctx context.Context, cookies []cdp.NetworkCookieParam) error + type DownloadExpectation struct + func (e *DownloadExpectation) Close() error + func (e *DownloadExpectation) Wait(ctx context.Context) (DownloadInfo, error) + func (e *DownloadExpectation) WaitBegin(ctx context.Context) (DownloadInfo, error) + type DownloadInfo struct + GUID string + Path string + ReceivedBytes float64 + SuggestedFilename string + TotalBytes float64 + URL string + type Element struct + func (e *Element) Apply(ctx context.Context, jsFunction string, out any, options ...EvaluateOptions) error + func (e *Element) Attributes() map[string]string + func (e *Element) Children() []*Element + func (e *Element) ClearInput(ctx context.Context) error + func (e *Element) ClearInputByDeleting(ctx context.Context) error + func (e *Element) Click(ctx context.Context) error + func (e *Element) ContentDocument() *Element + func (e *Element) Flash(ctx context.Context, duration ...time.Duration) error + func (e *Element) Focus(ctx context.Context) error + func (e *Element) Get(name string) string + func (e *Element) GetFrame(ctx context.Context) (*Tab, error) + func (e *Element) GetHTML(ctx context.Context) (string, error) + func (e *Element) GetJSAttributes(ctx context.Context) (map[string]any, error) + func (e *Element) GetPosition(ctx context.Context, absolute ...bool) (Position, error) + func (e *Element) HighlightOverlay(ctx context.Context) error + func (e *Element) IsRecording() bool + func (e *Element) MouseClick(ctx context.Context, options ...MouseOptions) error + func (e *Element) MouseDrag(ctx context.Context, destination *Element, steps ...int) error + func (e *Element) MouseMove(ctx context.Context) error + func (e *Element) Node() cdp.DOMNode + func (e *Element) ObjectID(ctx context.Context) (cdp.RuntimeRemoteObjectID, error) + func (e *Element) Parent(ctx context.Context) (*Element, error) + func (e *Element) PressKey(ctx context.Context, key string, modifiers ...KeyModifiers) error + func (e *Element) QuerySelector(ctx context.Context, selector string) (*Element, error) + func (e *Element) QuerySelectorAll(ctx context.Context, selector string) ([]*Element, error) + func (e *Element) RecordVideo(ctx context.Context, path string) (*VideoRecording, error) + func (e *Element) RemoteObject(ctx context.Context) (cdp.RuntimeRemoteObject, error) + func (e *Element) RemoveAttribute(ctx context.Context, name string) error + func (e *Element) RemoveFromDOM(ctx context.Context) error + func (e *Element) SaveScreenshot(ctx context.Context, path string, options ...ScreenshotOptions) error + func (e *Element) SaveToDOM(ctx context.Context, attributes ...map[string]string) error + func (e *Element) Screenshot(ctx context.Context, options ...ScreenshotOptions) ([]byte, error) + func (e *Element) ScreenshotBase64(ctx context.Context, options ...ScreenshotOptions) (string, error) + func (e *Element) ScrollIntoView(ctx context.Context) error + func (e *Element) SelectOption(ctx context.Context, values ...string) error + func (e *Element) SendFile(ctx context.Context, paths ...string) error + func (e *Element) SendKeys(ctx context.Context, text string) error + func (e *Element) SetAttribute(ctx context.Context, name, value string) error + func (e *Element) SetText(ctx context.Context, value string) error + func (e *Element) SetValue(ctx context.Context, value string) error + func (e *Element) ShadowChildren() []*Element + func (e *Element) ShadowRoots() []*Element + func (e *Element) Tab() *Tab + func (e *Element) TagName() string + func (e *Element) Text(ctx context.Context) (string, error) + func (e *Element) TextAll(ctx context.Context) (string, error) + func (e *Element) Update(ctx context.Context) error + type EvaluateOptions struct + AwaitPromise bool + ContextID *cdp.RuntimeExecutionContextID + RemoteObject bool + type Event struct + Method string + Params json.RawMessage + SessionID string + func (e Event) Decode(out any) error + type InterceptedRequest struct + Event cdp.FetchRequestPaused + func (r *InterceptedRequest) Body(ctx context.Context) ([]byte, error) + func (r *InterceptedRequest) Continue(ctx context.Context, options ...cdp.FetchContinueRequestParams) error + func (r *InterceptedRequest) ContinueResponse(ctx context.Context, options ...cdp.FetchContinueResponseParams) error + func (r *InterceptedRequest) Fail(ctx context.Context, reason cdp.NetworkErrorReason) error + func (r *InterceptedRequest) Fulfill(ctx context.Context, status int, body []byte, headers ...cdp.FetchHeaderEntry) error + type Interceptor struct + func (i *Interceptor) Close() error + func (i *Interceptor) Next(ctx context.Context) (*InterceptedRequest, error) + type JavaScriptError struct + Details cdp.RuntimeExceptionDetails + func (e *JavaScriptError) Error() string + type KeyInput struct + Key string + Modifiers KeyModifiers + Text string + type KeyModifiers int + const Alt + const Control + const Meta + const Shift + type MouseOptions struct + Button string + ClickCount int + Hold bool + Modifiers KeyModifiers + type NavigationOptions struct + NewTab bool + NewWindow bool + type Position struct + AbsX float64 + AbsY float64 + Bottom float64 + Height float64 + Left float64 + Right float64 + Top float64 + Width float64 + X float64 + Y float64 + func (p Position) Center() (float64, float64) + func (p Position) ToViewport(scale float64) cdp.PageViewport + type ProtocolError struct + Code int + Data json.RawMessage + Message string + Method string + func (e *ProtocolError) Error() string + type ProxyForwarder struct + func NewProxyForwarder(ctx context.Context, upstream string, tlsConfig *tls.Config) (*ProxyForwarder, error) + func (p *ProxyForwarder) Close() error + func (p *ProxyForwarder) ProxyServer() string + type QueryOptions struct + Exact bool + IncludeFrames bool + Timeout time.Duration + type RequestExpectation struct + func (e *RequestExpectation) Body(ctx context.Context) ([]byte, error) + func (e *RequestExpectation) Close() error + func (e *RequestExpectation) Reset(ctx context.Context) (*RequestExpectation, error) + func (e *RequestExpectation) WaitRequest(ctx context.Context) (cdp.NetworkRequestWillBeSent, error) + func (e *RequestExpectation) WaitResponse(ctx context.Context) (cdp.NetworkResponseReceived, error) + type ScreenshotOptions struct + Format string + FullPage bool + Quality *int + Scale float64 + type Subscription struct + func OnEvent[T cdp.Event](ctx context.Context, c *Connection, fn func(T)) (*Subscription, error) + func (s *Subscription) Close() error + type Tab struct + func (t *Tab) Activate(ctx context.Context) error + func (t *Tab) Back(ctx context.Context) error + func (t *Tab) BringToFront(ctx context.Context) error + func (t *Tab) Browser() *Browser + func (t *Tab) BypassInsecureConnectionWarning(ctx context.Context) error + func (t *Tab) Call(ctx context.Context, method string, params any) (json.RawMessage, error) + func (t *Tab) Close() error + func (t *Tab) CloseContext(ctx context.Context) error + func (t *Tab) Connection(ctx context.Context) (*Connection, error) + func (t *Tab) DisableDOMAgent(ctx context.Context) error + func (t *Tab) DispatchKeyEvents(ctx context.Context, events ...cdp.InputDispatchKeyEventParams) error + func (t *Tab) DownloadFile(ctx context.Context, address, path string) error + func (t *Tab) Enable(ctx context.Context, domain string) error + func (t *Tab) Evaluate(ctx context.Context, expression string, out any, options ...EvaluateOptions) error + func (t *Tab) ExpectDownload(ctx context.Context) (*DownloadExpectation, error) + func (t *Tab) ExpectRequest(ctx context.Context, urlPattern string) (*RequestExpectation, error) + func (t *Tab) ExpectResponse(ctx context.Context, urlPattern string) (*RequestExpectation, error) + func (t *Tab) Find(ctx context.Context, text string, options ...QueryOptions) (*Element, error) + func (t *Tab) FindAll(ctx context.Context, text string, options ...QueryOptions) (result []*Element, err error) + func (t *Tab) FindCloudflareChallenge(ctx context.Context) (*CloudflareChallenge, error) + func (t *Tab) FindElementByText(ctx context.Context, text string, bestMatch ...bool) (*Element, error) + func (t *Tab) FindElementsByText(ctx context.Context, text string, options ...QueryOptions) ([]*Element, error) + func (t *Tab) FlashPoint(ctx context.Context, x, y float64, duration ...float64) error + func (t *Tab) Forward(ctx context.Context) error + func (t *Tab) Fullscreen(ctx context.Context) error + func (t *Tab) Get(ctx context.Context, address string, options ...NavigationOptions) (*Tab, error) + func (t *Tab) GetAllLinkedSources(ctx context.Context) ([]*Element, error) + func (t *Tab) GetAllURLs(ctx context.Context, absolute ...bool) ([]string, error) + func (t *Tab) GetContent(ctx context.Context) (string, error) + func (t *Tab) GetFrames(ctx context.Context) ([]*Tab, error) + func (t *Tab) GetLocalStorage(ctx context.Context) (map[string]string, error) + func (t *Tab) GetWindow(ctx context.Context) (int, WindowBounds, error) + func (t *Tab) InsertText(ctx context.Context, text string) error + func (t *Tab) InspectorURL() string + func (t *Tab) Intercept(ctx context.Context, patterns ...cdp.FetchRequestPattern) (*Interceptor, error) + func (t *Tab) IsCloudflareChallengePresent(ctx context.Context) (bool, error) + func (t *Tab) IsScrolledToBottom(ctx context.Context) (bool, error) + func (t *Tab) JSDumps(ctx context.Context, expression string) (json.RawMessage, error) + func (t *Tab) Maximize(ctx context.Context) error + func (t *Tab) Medimize(ctx context.Context) error + func (t *Tab) Minimize(ctx context.Context) error + func (t *Tab) MouseClick(ctx context.Context, x, y float64, options ...MouseOptions) error + func (t *Tab) MouseDown(ctx context.Context, x, y float64, options ...MouseOptions) error + func (t *Tab) MouseDrag(ctx context.Context, fromX, fromY, toX, toY float64, steps ...int) error + func (t *Tab) MouseMove(ctx context.Context, x, y float64, steps ...int) error + func (t *Tab) MouseUp(ctx context.Context, x, y float64, options ...MouseOptions) error + func (t *Tab) Navigate(ctx context.Context, address string) error + func (t *Tab) On(ctx context.Context, method string, fn func(Event)) (*Subscription, error) + func (t *Tab) OpenExternalInspector() error + func (t *Tab) PressKey(ctx context.Context, key string, modifiers ...KeyModifiers) error + func (t *Tab) PrintToPDF(ctx context.Context, path string, options ...cdp.PagePrintToPDFParams) error + func (t *Tab) QuerySelector(ctx context.Context, selector string, options ...QueryOptions) (*Element, error) + func (t *Tab) QuerySelectorAll(ctx context.Context, selector string, options ...QueryOptions) ([]*Element, error) + func (t *Tab) Reload(ctx context.Context, ignoreCache ...bool) error + func (t *Tab) SaveScreenshot(ctx context.Context, path string, options ...ScreenshotOptions) error + func (t *Tab) SaveSnapshot(ctx context.Context, path string) error + func (t *Tab) Screenshot(ctx context.Context, options ...ScreenshotOptions) ([]byte, error) + func (t *Tab) ScreenshotBase64(ctx context.Context, options ...ScreenshotOptions) (string, error) + func (t *Tab) ScrollDown(ctx context.Context, amount int, speed ...int) error + func (t *Tab) ScrollUp(ctx context.Context, amount int, speed ...int) error + func (t *Tab) Select(ctx context.Context, selector string, options ...QueryOptions) (*Element, error) + func (t *Tab) SelectAll(ctx context.Context, selector string, options ...QueryOptions) (result []*Element, err error) + func (t *Tab) Send(ctx context.Context, method string, params, out any) error + func (t *Tab) SendKeys(ctx context.Context, inputs ...KeyInput) error + func (t *Tab) SetDownloadPath(ctx context.Context, path string) error + func (t *Tab) SetLocalStorage(ctx context.Context, items map[string]string) error + func (t *Tab) SetUserAgent(ctx context.Context, userAgent string, languagePlatform ...string) error + func (t *Tab) SetWindowSize(ctx context.Context, left, top, width, height int) error + func (t *Tab) SetWindowState(ctx context.Context, state string) error + func (t *Tab) Sleep(ctx context.Context, d time.Duration) error + func (t *Tab) Target() cdp.TargetTargetInfo + func (t *Tab) TargetID() string + func (t *Tab) Title() string + func (t *Tab) TypeText(ctx context.Context, text string) error + func (t *Tab) URL() string + func (t *Tab) UpdateTarget(ctx context.Context) error + func (t *Tab) VerifyCF(ctx context.Context, options ...CloudflareOptions) error + func (t *Tab) Wait(ctx context.Context, idle ...time.Duration) error + func (t *Tab) WaitFor(ctx context.Context, selector, text string, options ...QueryOptions) (*Element, error) + func (t *Tab) WaitForCloudflareChallenge(ctx context.Context) (*CloudflareChallenge, error) + func (t *Tab) WaitForReadyState(ctx context.Context, state string) error + func (t *Tab) XPath(ctx context.Context, xpath string, options ...QueryOptions) ([]*Element, error) + type VideoRecording struct + func (v *VideoRecording) Close() error + func (v *VideoRecording) Stop(ctx context.Context) error + type WindowBounds struct + Height int + Left int + State string + Top int + Width int