simple

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserConfig

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

type BrowserConfigOpt

type BrowserConfigOpt func(*BrowserConfig)

func WithHeadless

func WithHeadless(headless bool) BrowserConfigOpt

func WithNoSandBox

func WithNoSandBox(noSandBox bool) BrowserConfigOpt

func WithProxy

func WithProxy(proxyAddress string, proxyUserInfo ...string) BrowserConfigOpt

func WithRequestModification

func WithRequestModification(modifyUrl string, modifyTarget ModifyTarget, modifyResult interface{}) BrowserConfigOpt

func WithResponseModification

func WithResponseModification(modifyUrl string, modifyTarget ModifyTarget, modifyResult interface{}) BrowserConfigOpt

func WithWsAddress

func WithWsAddress(wsAddress string) BrowserConfigOpt

type ModifyTarget

type ModifyTarget string
var BodyModifyTarget ModifyTarget = "body"
var BodyReplaceTarget ModifyTarget = "bodyReplace"
var HeadersModifyTarget ModifyTarget = "headers"
var HostModifyTarget ModifyTarget = "host"

type RequestModification

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

func (*RequestModification) Generate

func (modification *RequestModification) Generate() error

func (*RequestModification) GetReg

func (modification *RequestModification) GetReg() *regexp.Regexp

func (*RequestModification) Modify

func (modification *RequestModification) Modify(request *rod.HijackRequest) error

type ResponseModification

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

func (*ResponseModification) Generate

func (modification *ResponseModification) Generate() error

func (*ResponseModification) GetReg

func (modification *ResponseModification) GetReg() *regexp.Regexp

func (*ResponseModification) Modify

func (modification *ResponseModification) Modify(response *rod.HijackResponse) error

type VBrowser

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

func CreateHeadlessBrowser

func CreateHeadlessBrowser(opts ...BrowserConfigOpt) *VBrowser

func (*VBrowser) BrowserInit

func (browser *VBrowser) BrowserInit() error

func (*VBrowser) Navigate

func (browser *VBrowser) Navigate(urlStr string) *VPage

type VPage

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

func (*VPage) Click

func (page *VPage) Click(selector string) error

func (*VPage) Element

func (page *VPage) Element(selector string) (*rod.Element, error)

func (*VPage) HTML

func (page *VPage) HTML() (string, error)

func (*VPage) Input

func (page *VPage) Input(selector, inputStr string) error

func (*VPage) Navigate

func (page *VPage) Navigate(urlStr string)

func (*VPage) ScreenShot

func (page *VPage) ScreenShot() (string, error)

Jump to

Keyboard shortcuts

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