browser

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package browser implements a headless-browser-based page fetcher using rod.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher struct {
	// contains filtered or unexported fields
}

Fetcher implements crawler.Fetcher using a headless browser via rod.

func NewFetcher

func NewFetcher(browserlessURL, userAgent string, timeout time.Duration, l logger.Logger) (*Fetcher, error)

NewFetcher creates a new Fetcher connected to a headless browser. If browserlessURL is non-empty, it connects to a remote browser instance; otherwise it launches a local headless browser.

func (*Fetcher) Close

func (f *Fetcher) Close() error

Close shuts down the browser instance and releases resources.

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(ctx context.Context, u string) (*model.Page, error)

Fetch navigates to the given URL in a new browser tab, waits for stability, and returns the rendered page content.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL