cdp

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 29 Imported by: 24

Documentation

Index

Constants

View Source
const (
	DefaultAddress    = "http://127.0.0.1:9222"
	DefaultBufferSize = 1048562
)
View Source
const BlankPageURL = "about:blank"
View Source
const DriverName = "cdp"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionOptions added in v0.16.0

type ConnectionOptions struct {
	BufferSize  int
	Compression bool
}

type Driver

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

func NewDriver

func NewDriver(opts ...Option) *Driver

func (*Driver) Close

func (drv *Driver) Close() error

func (*Driver) Name added in v0.7.0

func (drv *Driver) Name() string

func (*Driver) Open added in v0.8.0

func (drv *Driver) Open(ctx context.Context, params drivers.Params) (drivers.HTMLPage, error)

func (*Driver) Parse added in v0.10.0

func (drv *Driver) Parse(ctx context.Context, params drivers.ParseParams) (drivers.HTMLPage, error)

type HTMLPage added in v0.8.0

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

func LoadHTMLPage added in v0.8.0

func LoadHTMLPage(
	ctx context.Context,
	conn *rpcc.Conn,
	params drivers.Params,
) (p *HTMLPage, err error)

func LoadHTMLPageWithContent added in v0.10.0

func LoadHTMLPageWithContent(
	ctx context.Context,
	conn *rpcc.Conn,
	params drivers.Params,
	content []byte,
) (p *HTMLPage, err error)

func NewHTMLPage added in v0.8.0

func NewHTMLPage(
	logger zerolog.Logger,
	conn *rpcc.Conn,
	client *cdp.Client,
	netManager *net.Manager,
	domManager *dom.Manager,
) *HTMLPage

func (*HTMLPage) CaptureScreenshot added in v0.8.0

func (p *HTMLPage) CaptureScreenshot(ctx context.Context, params drivers.ScreenshotParams) (values.Binary, error)

func (*HTMLPage) Close added in v0.8.0

func (p *HTMLPage) Close() error

func (*HTMLPage) Compare added in v0.8.0

func (p *HTMLPage) Compare(other core.Value) int64

func (*HTMLPage) Copy added in v0.8.0

func (p *HTMLPage) Copy() core.Value

func (*HTMLPage) DeleteCookies added in v0.8.0

func (p *HTMLPage) DeleteCookies(ctx context.Context, cookies *drivers.HTTPCookies) error

func (*HTMLPage) GetCookies added in v0.8.0

func (p *HTMLPage) GetCookies(ctx context.Context) (*drivers.HTTPCookies, error)

func (*HTMLPage) GetFrame added in v0.8.0

func (p *HTMLPage) GetFrame(ctx context.Context, idx values.Int) (core.Value, error)

func (*HTMLPage) GetFrames added in v0.8.0

func (p *HTMLPage) GetFrames(ctx context.Context) (*values.Array, error)

func (*HTMLPage) GetIn added in v0.8.0

func (p *HTMLPage) GetIn(ctx context.Context, path []core.Value) (core.Value, core.PathError)

func (*HTMLPage) GetMainFrame added in v0.8.0

func (p *HTMLPage) GetMainFrame() drivers.HTMLDocument

func (*HTMLPage) GetResponse added in v0.10.0

func (p *HTMLPage) GetResponse(ctx context.Context) (drivers.HTTPResponse, error)

func (*HTMLPage) GetURL added in v0.8.0

func (p *HTMLPage) GetURL() values.String

func (*HTMLPage) Hash added in v0.8.0

func (p *HTMLPage) Hash() uint64

func (*HTMLPage) IsClosed added in v0.8.0

func (p *HTMLPage) IsClosed() values.Boolean

func (*HTMLPage) Iterate added in v0.8.0

func (p *HTMLPage) Iterate(ctx context.Context) (core.Iterator, error)

func (*HTMLPage) Length added in v0.8.0

func (p *HTMLPage) Length() values.Int

func (*HTMLPage) MarshalJSON added in v0.8.0

func (p *HTMLPage) MarshalJSON() ([]byte, error)

func (*HTMLPage) Navigate added in v0.8.0

func (p *HTMLPage) Navigate(ctx context.Context, url values.String) error

func (*HTMLPage) NavigateBack added in v0.8.0

func (p *HTMLPage) NavigateBack(ctx context.Context, skip values.Int) (values.Boolean, error)

func (*HTMLPage) NavigateForward added in v0.8.0

func (p *HTMLPage) NavigateForward(ctx context.Context, skip values.Int) (values.Boolean, error)

func (*HTMLPage) PrintToPDF added in v0.8.0

func (p *HTMLPage) PrintToPDF(ctx context.Context, params drivers.PDFParams) (values.Binary, error)

func (*HTMLPage) SetCookies added in v0.8.0

func (p *HTMLPage) SetCookies(ctx context.Context, cookies *drivers.HTTPCookies) error

func (*HTMLPage) SetIn added in v0.8.0

func (p *HTMLPage) SetIn(ctx context.Context, path []core.Value, value core.Value) core.PathError

func (*HTMLPage) String added in v0.8.0

func (p *HTMLPage) String() string

func (*HTMLPage) Subscribe added in v0.16.0

func (p *HTMLPage) Subscribe(ctx context.Context, subscription events.Subscription) (events.Stream, error)

func (*HTMLPage) Type added in v0.8.0

func (p *HTMLPage) Type() core.Type

func (*HTMLPage) Unwrap added in v0.8.0

func (p *HTMLPage) Unwrap() interface{}

func (*HTMLPage) WaitForFrameNavigation added in v0.12.0

func (p *HTMLPage) WaitForFrameNavigation(ctx context.Context, frame drivers.HTMLDocument, targetURL values.String) error

func (*HTMLPage) WaitForNavigation added in v0.8.0

func (p *HTMLPage) WaitForNavigation(ctx context.Context, targetURL values.String) error

type HTMLPageEvent added in v0.16.0

type HTMLPageEvent string

type Option

type Option func(opts *Options)

func WithAddress

func WithAddress(address string) Option

func WithBufferSize added in v0.16.0

func WithBufferSize(size int) Option

func WithCompression added in v0.16.0

func WithCompression() Option

func WithCookie added in v0.9.0

func WithCookie(cookie drivers.HTTPCookie) Option

func WithCookies added in v0.9.0

func WithCookies(cookies []drivers.HTTPCookie) Option

func WithCustomName added in v0.7.0

func WithCustomName(name string) Option

func WithHeader added in v0.9.0

func WithHeader(name string, header []string) Option

func WithHeaders added in v0.9.0

func WithHeaders(headers *drivers.HTTPHeaders) Option

func WithKeepCookies added in v0.7.0

func WithKeepCookies() Option

func WithNoCompression added in v0.16.0

func WithNoCompression() Option

func WithProxy

func WithProxy(address string) Option

func WithUserAgent

func WithUserAgent(value string) Option

type Options

type Options struct {
	*drivers.Options
	Address     string
	KeepCookies bool
	Connection  *ConnectionOptions
}

func NewOptions added in v0.14.1

func NewOptions(setters []Option) *Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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