rod

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultUserAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"

Variables

This section is empty.

Functions

func Close

func Close()

func HTMLToMarkdown

func HTMLToMarkdown(content, baseURL string, keepLinks bool) (string, error)

func SetMaxConcurrency

func SetMaxConcurrency(n int)

Types

type FetchError

type FetchError struct {
	Status int
	Href   string
}

func (*FetchError) Error

func (e *FetchError) Error() string

type FetchOption

type FetchOption struct {
	IdleWait  time.Duration
	MaxLength int
	UserAgent string
	KeepLinks bool
	StealthJS string
	SettleJS  string
	Viewport  *Viewport
}

type FetchResult

type FetchResult struct {
	Href        string
	FinalURL    string
	Markdown    string
	Title       string
	Author      string
	PublishedAt string
	Excerpt     string
	Status      int
}

func Fetch

func Fetch(ctx context.Context, href string, timeout time.Duration, opt *FetchOption) (*FetchResult, error)

func FetchWS

func FetchWS(ctx context.Context, controlURL, href string, timeout time.Duration, opt *FetchOption) (*FetchResult, error)

type Viewport

type Viewport struct {
	Width             int
	Height            int
	DeviceScaleFactor float64
}

Jump to

Keyboard shortcuts

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