Documentation ¶
Index ¶
- Constants
- type Driver
- type HTMLDocument
- func LoadHTMLDocument(ctx context.Context, logger *zerolog.Logger, client *cdp.Client, ...) (*HTMLDocument, error)
- func LoadRootHTMLDocument(ctx context.Context, logger *zerolog.Logger, client *cdp.Client, ...) (*HTMLDocument, error)
- func NewHTMLDocument(logger *zerolog.Logger, client *cdp.Client, events *events.EventBroker, ...) *HTMLDocument
- func (doc *HTMLDocument) ClickBySelector(ctx context.Context, selector values.String) error
- func (doc *HTMLDocument) ClickBySelectorAll(ctx context.Context, selector values.String) error
- func (doc *HTMLDocument) Close() error
- func (doc *HTMLDocument) Compare(other core.Value) int64
- func (doc *HTMLDocument) Copy() core.Value
- func (doc *HTMLDocument) CountBySelector(ctx context.Context, selector values.String) values.Int
- func (doc *HTMLDocument) ExistsBySelector(ctx context.Context, selector values.String) (values.Boolean, error)
- func (doc *HTMLDocument) FocusBySelector(ctx context.Context, selector values.String) error
- func (doc *HTMLDocument) GetChildDocuments(ctx context.Context) (*values.Array, error)
- func (doc *HTMLDocument) GetChildNode(ctx context.Context, idx values.Int) core.Value
- func (doc *HTMLDocument) GetChildNodes(ctx context.Context) core.Value
- func (doc *HTMLDocument) GetElement() drivers.HTMLElement
- func (doc *HTMLDocument) GetIn(ctx context.Context, path []core.Value) (core.Value, error)
- func (doc *HTMLDocument) GetName() values.String
- func (doc *HTMLDocument) GetNodeName() values.String
- func (doc *HTMLDocument) GetNodeType() values.Int
- func (doc *HTMLDocument) GetParentDocument() drivers.HTMLDocument
- func (doc *HTMLDocument) GetTitle() values.String
- func (doc *HTMLDocument) GetURL() values.String
- func (doc *HTMLDocument) Hash() uint64
- func (doc *HTMLDocument) InputBySelector(ctx context.Context, selector values.String, value core.Value, ...) error
- func (doc *HTMLDocument) IsDetached() values.Boolean
- func (doc *HTMLDocument) Iterate(ctx context.Context) (core.Iterator, error)
- func (doc *HTMLDocument) Length() values.Int
- func (doc *HTMLDocument) MarshalJSON() ([]byte, error)
- func (doc *HTMLDocument) MoveMouseBySelector(ctx context.Context, selector values.String) error
- func (doc *HTMLDocument) MoveMouseByXY(ctx context.Context, x, y values.Float) error
- func (doc *HTMLDocument) QuerySelector(ctx context.Context, selector values.String) core.Value
- func (doc *HTMLDocument) QuerySelectorAll(ctx context.Context, selector values.String) core.Value
- func (doc *HTMLDocument) ScrollBottom(ctx context.Context) error
- func (doc *HTMLDocument) ScrollBySelector(ctx context.Context, selector values.String) error
- func (doc *HTMLDocument) ScrollByXY(ctx context.Context, x, y values.Float) error
- func (doc *HTMLDocument) ScrollTop(ctx context.Context) error
- func (doc *HTMLDocument) SelectBySelector(ctx context.Context, selector values.String, value *values.Array) (*values.Array, error)
- func (doc *HTMLDocument) SetIn(ctx context.Context, path []core.Value, value core.Value) error
- func (doc *HTMLDocument) String() string
- func (doc *HTMLDocument) Type() core.Type
- func (doc *HTMLDocument) Unwrap() interface{}
- func (doc *HTMLDocument) WaitForAttributeBySelector(ctx context.Context, selector, name values.String, value core.Value, ...) error
- func (doc *HTMLDocument) WaitForAttributeBySelectorAll(ctx context.Context, selector, name values.String, value core.Value, ...) error
- func (doc *HTMLDocument) WaitForClassBySelector(ctx context.Context, selector, class values.String, when drivers.WaitEvent) error
- func (doc *HTMLDocument) WaitForClassBySelectorAll(ctx context.Context, selector, class values.String, when drivers.WaitEvent) error
- func (doc *HTMLDocument) WaitForElement(ctx context.Context, selector values.String, when drivers.WaitEvent) error
- func (doc *HTMLDocument) WaitForStyleBySelector(ctx context.Context, selector, name values.String, value core.Value, ...) error
- func (doc *HTMLDocument) WaitForStyleBySelectorAll(ctx context.Context, selector, name values.String, value core.Value, ...) error
- func (doc *HTMLDocument) XPath(ctx context.Context, expression values.String) (core.Value, error)
- type HTMLElement
- func LoadHTMLElement(ctx context.Context, logger *zerolog.Logger, client *cdp.Client, ...) (*HTMLElement, error)
- func LoadHTMLElementWithID(ctx context.Context, logger *zerolog.Logger, client *cdp.Client, ...) (*HTMLElement, error)
- func NewHTMLElement(logger *zerolog.Logger, client *cdp.Client, broker *events.EventBroker, ...) *HTMLElement
- func (el *HTMLElement) Click(ctx context.Context) error
- func (el *HTMLElement) Close() error
- func (el *HTMLElement) Compare(other core.Value) int64
- func (el *HTMLElement) Copy() core.Value
- func (el *HTMLElement) CountBySelector(ctx context.Context, selector values.String) values.Int
- func (el *HTMLElement) ExistsBySelector(ctx context.Context, selector values.String) (values.Boolean, error)
- func (el *HTMLElement) Focus(ctx context.Context) error
- func (el *HTMLElement) GetAttribute(ctx context.Context, name values.String) core.Value
- func (el *HTMLElement) GetAttributes(ctx context.Context) *values.Object
- func (el *HTMLElement) GetChildNode(ctx context.Context, idx values.Int) core.Value
- func (el *HTMLElement) GetChildNodes(ctx context.Context) core.Value
- func (el *HTMLElement) GetIn(ctx context.Context, path []core.Value) (core.Value, error)
- func (el *HTMLElement) GetInnerHTML(ctx context.Context) (values.String, error)
- func (el *HTMLElement) GetInnerHTMLBySelector(ctx context.Context, selector values.String) (values.String, error)
- func (el *HTMLElement) GetInnerHTMLBySelectorAll(ctx context.Context, selector values.String) (*values.Array, error)
- func (el *HTMLElement) GetInnerText(ctx context.Context) (values.String, error)
- func (el *HTMLElement) GetInnerTextBySelector(ctx context.Context, selector values.String) (values.String, error)
- func (el *HTMLElement) GetInnerTextBySelectorAll(ctx context.Context, selector values.String) (*values.Array, error)
- func (el *HTMLElement) GetNodeName() values.String
- func (el *HTMLElement) GetNodeType() values.Int
- func (el *HTMLElement) GetStyle(ctx context.Context, name values.String) (core.Value, error)
- func (el *HTMLElement) GetStyles(ctx context.Context) (*values.Object, error)
- func (el *HTMLElement) GetValue(ctx context.Context) core.Value
- func (el *HTMLElement) Hash() uint64
- func (el *HTMLElement) Hover(ctx context.Context) error
- func (el *HTMLElement) Input(ctx context.Context, value core.Value, delay values.Int) error
- func (el *HTMLElement) IsDetached() values.Boolean
- func (el *HTMLElement) Iterate(_ context.Context) (core.Iterator, error)
- func (el *HTMLElement) Length() values.Int
- func (el *HTMLElement) MarshalJSON() ([]byte, error)
- func (el *HTMLElement) QuerySelector(ctx context.Context, selector values.String) core.Value
- func (el *HTMLElement) QuerySelectorAll(ctx context.Context, selector values.String) core.Value
- func (el *HTMLElement) RemoveAttribute(ctx context.Context, names ...values.String) error
- func (el *HTMLElement) RemoveStyle(ctx context.Context, names ...values.String) error
- func (el *HTMLElement) ScrollIntoView(ctx context.Context) error
- func (el *HTMLElement) Select(ctx context.Context, value *values.Array) (*values.Array, error)
- func (el *HTMLElement) SetAttribute(ctx context.Context, name, value values.String) error
- func (el *HTMLElement) SetAttributes(ctx context.Context, attrs *values.Object) error
- func (el *HTMLElement) SetIn(ctx context.Context, path []core.Value, value core.Value) error
- func (el *HTMLElement) SetInnerHTML(ctx context.Context, innerHTML values.String) error
- func (el *HTMLElement) SetInnerHTMLBySelector(ctx context.Context, selector, innerHTML values.String) error
- func (el *HTMLElement) SetInnerText(ctx context.Context, innerText values.String) error
- func (el *HTMLElement) SetInnerTextBySelector(ctx context.Context, selector, innerText values.String) error
- func (el *HTMLElement) SetStyle(ctx context.Context, name values.String, value core.Value) error
- func (el *HTMLElement) SetStyles(ctx context.Context, styles *values.Object) error
- func (el *HTMLElement) SetValue(ctx context.Context, value core.Value) error
- func (el *HTMLElement) String() string
- func (el *HTMLElement) Type() core.Type
- func (el *HTMLElement) Unwrap() interface{}
- func (el *HTMLElement) WaitForAttribute(ctx context.Context, name values.String, value core.Value, ...) error
- func (el *HTMLElement) WaitForClass(ctx context.Context, class values.String, when drivers.WaitEvent) error
- func (el *HTMLElement) WaitForStyle(ctx context.Context, name values.String, value core.Value, ...) error
- func (el *HTMLElement) XPath(ctx context.Context, expression values.String) (result core.Value, err error)
- type HTMLElementIdentity
- type HTMLPage
- func (p *HTMLPage) CaptureScreenshot(ctx context.Context, params drivers.ScreenshotParams) (values.Binary, error)
- func (p *HTMLPage) Close() error
- func (p *HTMLPage) Compare(other core.Value) int64
- func (p *HTMLPage) Copy() core.Value
- func (p *HTMLPage) DeleteCookies(ctx context.Context, cookies ...drivers.HTTPCookie) error
- func (p *HTMLPage) GetCookies(ctx context.Context) (*values.Array, error)
- func (p *HTMLPage) GetFrame(ctx context.Context, idx values.Int) (core.Value, error)
- func (p *HTMLPage) GetFrames(ctx context.Context) (*values.Array, error)
- func (p *HTMLPage) GetIn(ctx context.Context, path []core.Value) (core.Value, error)
- func (p *HTMLPage) GetMainFrame() drivers.HTMLDocument
- func (p *HTMLPage) GetURL() values.String
- func (p *HTMLPage) Hash() uint64
- func (p *HTMLPage) IsClosed() values.Boolean
- func (p *HTMLPage) Iterate(ctx context.Context) (core.Iterator, error)
- func (p *HTMLPage) Length() values.Int
- func (p *HTMLPage) MarshalJSON() ([]byte, error)
- func (p *HTMLPage) Navigate(ctx context.Context, url values.String) error
- func (p *HTMLPage) NavigateBack(ctx context.Context, skip values.Int) (values.Boolean, error)
- func (p *HTMLPage) NavigateForward(ctx context.Context, skip values.Int) (values.Boolean, error)
- func (p *HTMLPage) PrintToPDF(ctx context.Context, params drivers.PDFParams) (values.Binary, error)
- func (p *HTMLPage) SetCookies(ctx context.Context, cookies ...drivers.HTTPCookie) error
- func (p *HTMLPage) SetIn(ctx context.Context, path []core.Value, value core.Value) error
- func (p *HTMLPage) String() string
- func (p *HTMLPage) Type() core.Type
- func (p *HTMLPage) Unwrap() interface{}
- func (p *HTMLPage) WaitForNavigation(ctx context.Context) error
- type Option
- type Options
Constants ¶
View Source
const BlankPageURL = "about:blank"
View Source
const DefaultAddress = "http://127.0.0.1:9222"
View Source
const DefaultTimeout = 5000 * time.Millisecond
View Source
const DriverName = "cdp"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTMLDocument ¶
type HTMLDocument struct {
// contains filtered or unexported fields
}
func LoadHTMLDocument ¶
func LoadRootHTMLDocument ¶ added in v0.8.0
func NewHTMLDocument ¶
func NewHTMLDocument( logger *zerolog.Logger, client *cdp.Client, events *events.EventBroker, input *input.Manager, exec *eval.ExecutionContext, rootElement *HTMLElement, frames page.FrameTree, parent *HTMLDocument, ) *HTMLDocument
func (*HTMLDocument) ClickBySelector ¶
func (*HTMLDocument) ClickBySelectorAll ¶
func (*HTMLDocument) Close ¶
func (doc *HTMLDocument) Close() error
func (*HTMLDocument) Copy ¶
func (doc *HTMLDocument) Copy() core.Value
func (*HTMLDocument) CountBySelector ¶
func (*HTMLDocument) ExistsBySelector ¶
func (*HTMLDocument) FocusBySelector ¶ added in v0.8.0
func (*HTMLDocument) GetChildDocuments ¶ added in v0.8.0
func (*HTMLDocument) GetChildNode ¶
func (*HTMLDocument) GetChildNodes ¶
func (doc *HTMLDocument) GetChildNodes(ctx context.Context) core.Value
func (*HTMLDocument) GetElement ¶ added in v0.8.0
func (doc *HTMLDocument) GetElement() drivers.HTMLElement
func (*HTMLDocument) GetName ¶ added in v0.8.0
func (doc *HTMLDocument) GetName() values.String
func (*HTMLDocument) GetNodeName ¶ added in v0.8.0
func (doc *HTMLDocument) GetNodeName() values.String
func (*HTMLDocument) GetNodeType ¶ added in v0.8.0
func (doc *HTMLDocument) GetNodeType() values.Int
func (*HTMLDocument) GetParentDocument ¶ added in v0.8.0
func (doc *HTMLDocument) GetParentDocument() drivers.HTMLDocument
func (*HTMLDocument) GetTitle ¶ added in v0.8.0
func (doc *HTMLDocument) GetTitle() values.String
func (*HTMLDocument) GetURL ¶ added in v0.7.0
func (doc *HTMLDocument) GetURL() values.String
func (*HTMLDocument) Hash ¶
func (doc *HTMLDocument) Hash() uint64
func (*HTMLDocument) InputBySelector ¶
func (*HTMLDocument) IsDetached ¶ added in v0.8.0
func (doc *HTMLDocument) IsDetached() values.Boolean
func (*HTMLDocument) Length ¶
func (doc *HTMLDocument) Length() values.Int
func (*HTMLDocument) MarshalJSON ¶
func (doc *HTMLDocument) MarshalJSON() ([]byte, error)
func (*HTMLDocument) MoveMouseBySelector ¶ added in v0.7.0
func (*HTMLDocument) MoveMouseByXY ¶ added in v0.7.0
func (*HTMLDocument) QuerySelector ¶
func (*HTMLDocument) QuerySelectorAll ¶
func (*HTMLDocument) ScrollBottom ¶
func (doc *HTMLDocument) ScrollBottom(ctx context.Context) error
func (*HTMLDocument) ScrollBySelector ¶
func (*HTMLDocument) ScrollByXY ¶ added in v0.7.0
func (*HTMLDocument) SelectBySelector ¶
func (*HTMLDocument) String ¶
func (doc *HTMLDocument) String() string
func (*HTMLDocument) Type ¶
func (doc *HTMLDocument) Type() core.Type
func (*HTMLDocument) Unwrap ¶
func (doc *HTMLDocument) Unwrap() interface{}
func (*HTMLDocument) WaitForAttributeBySelector ¶ added in v0.7.0
func (*HTMLDocument) WaitForAttributeBySelectorAll ¶ added in v0.7.0
func (*HTMLDocument) WaitForClassBySelector ¶ added in v0.7.0
func (*HTMLDocument) WaitForClassBySelectorAll ¶ added in v0.7.0
func (*HTMLDocument) WaitForElement ¶ added in v0.7.0
func (*HTMLDocument) WaitForStyleBySelector ¶ added in v0.7.0
func (*HTMLDocument) WaitForStyleBySelectorAll ¶ added in v0.7.0
type HTMLElement ¶
type HTMLElement struct {
// contains filtered or unexported fields
}
func LoadHTMLElement ¶ added in v0.8.0
func LoadHTMLElementWithID ¶ added in v0.8.0
func LoadHTMLElementWithID( ctx context.Context, logger *zerolog.Logger, client *cdp.Client, broker *events.EventBroker, input *input.Manager, exec *eval.ExecutionContext, id HTMLElementIdentity, ) (*HTMLElement, error)
func NewHTMLElement ¶
func NewHTMLElement( logger *zerolog.Logger, client *cdp.Client, broker *events.EventBroker, input *input.Manager, exec *eval.ExecutionContext, id HTMLElementIdentity, nodeType int, nodeName string, value string, children []HTMLElementIdentity, ) *HTMLElement
func (*HTMLElement) Close ¶
func (el *HTMLElement) Close() error
func (*HTMLElement) Copy ¶
func (el *HTMLElement) Copy() core.Value
func (*HTMLElement) CountBySelector ¶
func (*HTMLElement) ExistsBySelector ¶
func (*HTMLElement) GetAttribute ¶
func (*HTMLElement) GetAttributes ¶
func (el *HTMLElement) GetAttributes(ctx context.Context) *values.Object
func (*HTMLElement) GetChildNode ¶
func (*HTMLElement) GetChildNodes ¶
func (el *HTMLElement) GetChildNodes(ctx context.Context) core.Value
func (*HTMLElement) GetInnerHTML ¶ added in v0.8.0
func (*HTMLElement) GetInnerHTMLBySelector ¶ added in v0.8.0
func (*HTMLElement) GetInnerHTMLBySelectorAll ¶ added in v0.8.0
func (*HTMLElement) GetInnerText ¶ added in v0.8.0
func (*HTMLElement) GetInnerTextBySelector ¶ added in v0.8.0
func (*HTMLElement) GetInnerTextBySelectorAll ¶ added in v0.8.0
func (*HTMLElement) GetNodeName ¶ added in v0.8.0
func (el *HTMLElement) GetNodeName() values.String
func (*HTMLElement) GetNodeType ¶ added in v0.8.0
func (el *HTMLElement) GetNodeType() values.Int
func (*HTMLElement) GetValue ¶ added in v0.7.0
func (el *HTMLElement) GetValue(ctx context.Context) core.Value
func (*HTMLElement) Hash ¶
func (el *HTMLElement) Hash() uint64
func (*HTMLElement) IsDetached ¶ added in v0.8.0
func (el *HTMLElement) IsDetached() values.Boolean
func (*HTMLElement) Length ¶
func (el *HTMLElement) Length() values.Int
func (*HTMLElement) MarshalJSON ¶
func (el *HTMLElement) MarshalJSON() ([]byte, error)
func (*HTMLElement) QuerySelector ¶
func (*HTMLElement) QuerySelectorAll ¶
func (*HTMLElement) RemoveAttribute ¶ added in v0.7.0
func (*HTMLElement) RemoveStyle ¶ added in v0.7.0
func (*HTMLElement) ScrollIntoView ¶
func (el *HTMLElement) ScrollIntoView(ctx context.Context) error
func (*HTMLElement) SetAttribute ¶ added in v0.7.0
func (*HTMLElement) SetAttributes ¶ added in v0.7.0
func (*HTMLElement) SetInnerHTML ¶ added in v0.8.0
func (*HTMLElement) SetInnerHTMLBySelector ¶ added in v0.8.0
func (*HTMLElement) SetInnerText ¶ added in v0.8.0
func (*HTMLElement) SetInnerTextBySelector ¶ added in v0.8.0
func (*HTMLElement) String ¶
func (el *HTMLElement) String() string
func (*HTMLElement) Type ¶
func (el *HTMLElement) Type() core.Type
func (*HTMLElement) Unwrap ¶
func (el *HTMLElement) Unwrap() interface{}
func (*HTMLElement) WaitForAttribute ¶ added in v0.7.0
func (*HTMLElement) WaitForClass ¶
func (*HTMLElement) WaitForStyle ¶ added in v0.7.0
type HTMLElementIdentity ¶
type HTMLElementIdentity struct {
// contains filtered or unexported fields
}
type HTMLPage ¶ added in v0.8.0
type HTMLPage struct {
// contains filtered or unexported fields
}
func LoadHTMLPage ¶ added in v0.8.0
func NewHTMLPage ¶ added in v0.8.0
func (*HTMLPage) CaptureScreenshot ¶ added in v0.8.0
func (*HTMLPage) DeleteCookies ¶ added in v0.8.0
func (*HTMLPage) GetCookies ¶ added in v0.8.0
func (*HTMLPage) GetMainFrame ¶ added in v0.8.0
func (p *HTMLPage) GetMainFrame() drivers.HTMLDocument
func (*HTMLPage) MarshalJSON ¶ added in v0.8.0
func (*HTMLPage) NavigateBack ¶ added in v0.8.0
func (*HTMLPage) NavigateForward ¶ added in v0.8.0
func (*HTMLPage) PrintToPDF ¶ added in v0.8.0
func (*HTMLPage) SetCookies ¶ added in v0.8.0
type Option ¶
type Option func(opts *Options)
func WithAddress ¶
func WithCustomName ¶ added in v0.7.0
func WithKeepCookies ¶ added in v0.7.0
func WithKeepCookies() Option
func WithUserAgent ¶
Click to show internal directories.
Click to hide internal directories.