Documentation
¶
Overview ¶
Package cdp implements the Chrome DevTools Protocol HTML driver.
Index ¶
- Constants
- type ConnectionOptions
- type Driver
- type HTMLPage
- func LoadHTMLPage(ctx context.Context, conn *rpcc.Conn, params drivers.Params) (p *HTMLPage, err error)
- func LoadHTMLPageWithContent(ctx context.Context, conn *rpcc.Conn, params drivers.Params, content []byte) (p *HTMLPage, err error)
- func NewHTMLPage(logger zerolog.Logger, conn *rpcc.Conn, client *cdp.Client, ...) *HTMLPage
- func (p *HTMLPage) CaptureScreenshot(ctx context.Context, params drivers.ScreenshotParams) (runtime.Binary, error)
- func (p *HTMLPage) Close() error
- func (p *HTMLPage) Compare(other runtime.Value) int
- func (p *HTMLPage) Copy() runtime.Value
- func (p *HTMLPage) DeleteCookies(ctx context.Context, cookies *drivers.HTTPCookies) error
- func (p *HTMLPage) Dispatch(ctx context.Context, event runtime.DispatchEvent) error
- func (p *HTMLPage) Get(ctx context.Context, key runtime.Value) (runtime.Value, error)
- func (p *HTMLPage) GetCookies(ctx context.Context) (*drivers.HTTPCookies, error)
- func (p *HTMLPage) GetFrame(ctx context.Context, idx runtime.Int) (runtime.Value, error)
- func (p *HTMLPage) GetFrames(ctx context.Context) (runtime.List, error)
- func (p *HTMLPage) GetMainFrame() drivers.HTMLDocument
- func (p *HTMLPage) GetResponse(ctx context.Context) (drivers.HTTPResponse, error)
- func (p *HTMLPage) GetURL() runtime.String
- func (p *HTMLPage) Hash() uint64
- func (p *HTMLPage) IsClosed() runtime.Boolean
- func (p *HTMLPage) Iterate(ctx context.Context) (runtime.Iterator, error)
- func (p *HTMLPage) Length(ctx context.Context) (runtime.Int, error)
- func (p *HTMLPage) MarshalJSON() ([]byte, error)
- func (p *HTMLPage) Navigate(ctx context.Context, url runtime.String) error
- func (p *HTMLPage) NavigateBack(ctx context.Context, skip runtime.Int) (runtime.Boolean, error)
- func (p *HTMLPage) NavigateForward(ctx context.Context, skip runtime.Int) (runtime.Boolean, error)
- func (p *HTMLPage) PrintToPDF(ctx context.Context, params drivers.PDFParams) (runtime.Binary, error)
- func (p *HTMLPage) Set(ctx context.Context, key runtime.Value, value runtime.Value) error
- func (p *HTMLPage) SetCookies(ctx context.Context, cookies *drivers.HTTPCookies) error
- func (p *HTMLPage) String() string
- func (p *HTMLPage) Subscribe(ctx context.Context, subscription runtime.Subscription) (runtime.Stream, error)
- func (p *HTMLPage) Type() runtime.Type
- func (p *HTMLPage) Unwrap() any
- func (p *HTMLPage) WaitForFrameNavigation(ctx context.Context, frame drivers.HTMLDocument, targetURL runtime.String) error
- func (p *HTMLPage) WaitForNavigation(ctx context.Context, targetURL runtime.String) error
- type HTMLPageEvent
- type Option
- func WithAddress(address string) Option
- func WithBufferSize(size int) Option
- func WithCompression() Option
- func WithCookie(cookie drivers.HTTPCookie) Option
- func WithCookies(cookies []drivers.HTTPCookie) Option
- func WithCustomName(name string) Option
- func WithHeader(name string, header []string) Option
- func WithHeaders(headers textproto.MIMEHeader) Option
- func WithKeepCookies() Option
- func WithNoCompression() Option
- func WithProxy(address string) Option
- func WithUserAgent(value string) Option
- type Options
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 ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
type HTMLPage ¶
type HTMLPage struct {
// contains filtered or unexported fields
}
func LoadHTMLPage ¶
func LoadHTMLPageWithContent ¶
func NewHTMLPage ¶
func (*HTMLPage) CaptureScreenshot ¶
func (*HTMLPage) DeleteCookies ¶
func (*HTMLPage) GetCookies ¶
func (*HTMLPage) GetMainFrame ¶
func (p *HTMLPage) GetMainFrame() drivers.HTMLDocument
func (*HTMLPage) GetResponse ¶
func (*HTMLPage) MarshalJSON ¶
func (*HTMLPage) NavigateBack ¶
func (*HTMLPage) NavigateForward ¶
func (*HTMLPage) PrintToPDF ¶
func (*HTMLPage) SetCookies ¶
func (*HTMLPage) WaitForFrameNavigation ¶
type HTMLPageEvent ¶
type HTMLPageEvent string
type Option ¶
type Option func(opts *Options)
func WithAddress ¶
func WithBufferSize ¶
func WithCompression ¶
func WithCompression() Option
func WithCookie ¶
func WithCookie(cookie drivers.HTTPCookie) Option
func WithCookies ¶
func WithCookies(cookies []drivers.HTTPCookie) Option
func WithCustomName ¶
func WithHeader ¶
func WithHeaders ¶
func WithHeaders(headers textproto.MIMEHeader) Option
func WithKeepCookies ¶
func WithKeepCookies() Option
func WithNoCompression ¶
func WithNoCompression() Option
func WithUserAgent ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dom provides DOM helpers for the CDP HTML driver.
|
Package dom provides DOM helpers for the CDP HTML driver. |
|
Package eval builds JavaScript evaluation helpers for the CDP HTML driver.
|
Package eval builds JavaScript evaluation helpers for the CDP HTML driver. |
|
Package events provides event stream helpers for the CDP HTML driver.
|
Package events provides event stream helpers for the CDP HTML driver. |
|
Package input provides input emulation helpers for the CDP HTML driver.
|
Package input provides input emulation helpers for the CDP HTML driver. |
|
Package network provides network management for the CDP HTML driver.
|
Package network provides network management for the CDP HTML driver. |
|
Package templates provides JavaScript templates for the CDP HTML driver.
|
Package templates provides JavaScript templates for the CDP HTML driver. |
|
Package utils provides utility helpers for the CDP HTML driver.
|
Package utils provides utility helpers for the CDP HTML driver. |
Click to show internal directories.
Click to hide internal directories.