dom

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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FrameIDType = core.NewType("ferret.drivers.cdp.dom.FrameID")

Functions

func NewNodeLoader added in v0.16.0

func NewNodeLoader(dom *Manager) eval.ValueLoader

Types

type AtomicFrameCollection added in v0.12.0

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

func NewAtomicFrameCollection added in v0.12.0

func NewAtomicFrameCollection() *AtomicFrameCollection

func (*AtomicFrameCollection) ForEach added in v0.12.0

func (fc *AtomicFrameCollection) ForEach(predicate func(value Frame, key page.FrameID) bool)

func (*AtomicFrameCollection) Get added in v0.12.0

func (fc *AtomicFrameCollection) Get(key page.FrameID) (Frame, bool)

func (*AtomicFrameCollection) Has added in v0.12.0

func (fc *AtomicFrameCollection) Has(key page.FrameID) bool

func (*AtomicFrameCollection) Length added in v0.12.0

func (fc *AtomicFrameCollection) Length() int

func (*AtomicFrameCollection) Remove added in v0.12.0

func (fc *AtomicFrameCollection) Remove(key page.FrameID)

func (*AtomicFrameCollection) Set added in v0.12.0

func (fc *AtomicFrameCollection) Set(key page.FrameID, value Frame)

func (*AtomicFrameCollection) ToSlice added in v0.12.0

func (fc *AtomicFrameCollection) ToSlice() []Frame

type AtomicFrameID added in v0.12.0

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

func NewAtomicFrameID added in v0.12.0

func NewAtomicFrameID() *AtomicFrameID

func (*AtomicFrameID) Get added in v0.12.0

func (id *AtomicFrameID) Get() page.FrameID

func (*AtomicFrameID) IsEmpty added in v0.12.0

func (id *AtomicFrameID) IsEmpty() bool

func (*AtomicFrameID) Reset added in v0.12.0

func (id *AtomicFrameID) Reset()

func (*AtomicFrameID) Set added in v0.12.0

func (id *AtomicFrameID) Set(value page.FrameID)

type Frame

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

type FrameID added in v0.16.0

type FrameID page.FrameID

func NewFrameID added in v0.16.0

func NewFrameID(id page.FrameID) FrameID

func (FrameID) Compare added in v0.16.0

func (f FrameID) Compare(other core.Value) int64

func (FrameID) Copy added in v0.16.0

func (f FrameID) Copy() core.Value

func (FrameID) Hash added in v0.16.0

func (f FrameID) Hash() uint64

func (FrameID) MarshalJSON added in v0.16.0

func (f FrameID) MarshalJSON() ([]byte, error)

func (FrameID) String added in v0.16.0

func (f FrameID) String() string

func (FrameID) Type added in v0.16.0

func (f FrameID) Type() core.Type

func (FrameID) Unwrap added in v0.16.0

func (f FrameID) Unwrap() interface{}

type HTMLDocument

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

func NewHTMLDocument

func NewHTMLDocument(
	logger zerolog.Logger,
	client *cdp.Client,
	domManager *Manager,
	input *input.Manager,
	exec *eval.Runtime,
	rootElement *HTMLElement,
	frames page.FrameTree,
) *HTMLDocument

func (*HTMLDocument) Close

func (doc *HTMLDocument) Close() error

func (*HTMLDocument) Compare

func (doc *HTMLDocument) Compare(other core.Value) int64

func (*HTMLDocument) Copy

func (doc *HTMLDocument) Copy() core.Value

func (*HTMLDocument) CountBySelector

func (doc *HTMLDocument) CountBySelector(ctx context.Context, selector drivers.QuerySelector) (values.Int, error)

func (*HTMLDocument) Eval added in v0.14.0

func (doc *HTMLDocument) Eval() *eval.Runtime

func (*HTMLDocument) ExistsBySelector

func (doc *HTMLDocument) ExistsBySelector(ctx context.Context, selector drivers.QuerySelector) (values.Boolean, error)

func (*HTMLDocument) Frame

func (doc *HTMLDocument) Frame() page.FrameTree

func (*HTMLDocument) GetChildDocuments

func (doc *HTMLDocument) GetChildDocuments(ctx context.Context) (*values.Array, error)

func (*HTMLDocument) GetChildNode

func (doc *HTMLDocument) GetChildNode(ctx context.Context, idx values.Int) (core.Value, error)

func (*HTMLDocument) GetChildNodes

func (doc *HTMLDocument) GetChildNodes(ctx context.Context) (*values.Array, error)

func (*HTMLDocument) GetElement

func (doc *HTMLDocument) GetElement() drivers.HTMLElement

func (*HTMLDocument) GetIn

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

func (*HTMLDocument) GetName

func (doc *HTMLDocument) GetName() values.String

func (*HTMLDocument) GetNodeName

func (doc *HTMLDocument) GetNodeName(_ context.Context) (values.String, error)

func (*HTMLDocument) GetNodeType

func (doc *HTMLDocument) GetNodeType(_ context.Context) (values.Int, error)

func (*HTMLDocument) GetParentDocument

func (doc *HTMLDocument) GetParentDocument(ctx context.Context) (drivers.HTMLDocument, error)

func (*HTMLDocument) GetTitle

func (doc *HTMLDocument) GetTitle() values.String

func (*HTMLDocument) GetURL

func (doc *HTMLDocument) GetURL() values.String

func (*HTMLDocument) Hash

func (doc *HTMLDocument) Hash() uint64

func (*HTMLDocument) Iterate

func (doc *HTMLDocument) Iterate(ctx context.Context) (core.Iterator, error)

func (*HTMLDocument) Length

func (doc *HTMLDocument) Length() values.Int

func (*HTMLDocument) MarshalJSON

func (doc *HTMLDocument) MarshalJSON() ([]byte, error)

func (*HTMLDocument) MoveMouseByXY

func (doc *HTMLDocument) MoveMouseByXY(ctx context.Context, x, y values.Float) error

func (*HTMLDocument) QuerySelector

func (doc *HTMLDocument) QuerySelector(ctx context.Context, selector drivers.QuerySelector) (core.Value, error)

func (*HTMLDocument) QuerySelectorAll

func (doc *HTMLDocument) QuerySelectorAll(ctx context.Context, selector drivers.QuerySelector) (*values.Array, error)

func (*HTMLDocument) Scroll added in v0.16.0

func (doc *HTMLDocument) Scroll(ctx context.Context, options drivers.ScrollOptions) error

func (*HTMLDocument) ScrollBottom

func (doc *HTMLDocument) ScrollBottom(ctx context.Context, options drivers.ScrollOptions) error

func (*HTMLDocument) ScrollBySelector

func (doc *HTMLDocument) ScrollBySelector(ctx context.Context, selector drivers.QuerySelector, options drivers.ScrollOptions) error

func (*HTMLDocument) ScrollTop

func (doc *HTMLDocument) ScrollTop(ctx context.Context, options drivers.ScrollOptions) error

func (*HTMLDocument) SetIn

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

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

func (doc *HTMLDocument) WaitForAttributeBySelector(
	ctx context.Context,
	selector drivers.QuerySelector,
	name,
	value values.String,
	when drivers.WaitEvent,
) error

func (*HTMLDocument) WaitForAttributeBySelectorAll

func (doc *HTMLDocument) WaitForAttributeBySelectorAll(
	ctx context.Context,
	selector drivers.QuerySelector,
	name,
	value values.String,
	when drivers.WaitEvent,
) error

func (*HTMLDocument) WaitForClassBySelector

func (doc *HTMLDocument) WaitForClassBySelector(ctx context.Context, selector drivers.QuerySelector, class values.String, when drivers.WaitEvent) error

func (*HTMLDocument) WaitForClassBySelectorAll

func (doc *HTMLDocument) WaitForClassBySelectorAll(ctx context.Context, selector drivers.QuerySelector, class values.String, when drivers.WaitEvent) error

func (*HTMLDocument) WaitForElement

func (doc *HTMLDocument) WaitForElement(ctx context.Context, selector drivers.QuerySelector, when drivers.WaitEvent) error

func (*HTMLDocument) WaitForStyleBySelector

func (doc *HTMLDocument) WaitForStyleBySelector(ctx context.Context, selector drivers.QuerySelector, name, value values.String, when drivers.WaitEvent) error

func (*HTMLDocument) WaitForStyleBySelectorAll

func (doc *HTMLDocument) WaitForStyleBySelectorAll(ctx context.Context, selector drivers.QuerySelector, name, value values.String, when drivers.WaitEvent) error

func (*HTMLDocument) XPath

func (doc *HTMLDocument) XPath(ctx context.Context, expression values.String) (core.Value, error)

type HTMLElement

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

func NewHTMLElement

func NewHTMLElement(
	logger zerolog.Logger,
	client *cdp.Client,
	domManager *Manager,
	input *input.Manager,
	exec *eval.Runtime,
	id runtime.RemoteObjectID,
) *HTMLElement

func (*HTMLElement) Blur

func (el *HTMLElement) Blur(ctx context.Context) error

func (*HTMLElement) BlurBySelector

func (el *HTMLElement) BlurBySelector(ctx context.Context, selector drivers.QuerySelector) error

func (*HTMLElement) Clear

func (el *HTMLElement) Clear(ctx context.Context) error

func (*HTMLElement) ClearBySelector

func (el *HTMLElement) ClearBySelector(ctx context.Context, selector drivers.QuerySelector) error

func (*HTMLElement) Click

func (el *HTMLElement) Click(ctx context.Context, count values.Int) error

func (*HTMLElement) ClickBySelector

func (el *HTMLElement) ClickBySelector(ctx context.Context, selector drivers.QuerySelector, count values.Int) error

func (*HTMLElement) ClickBySelectorAll

func (el *HTMLElement) ClickBySelectorAll(ctx context.Context, selector drivers.QuerySelector, count values.Int) error

func (*HTMLElement) Close

func (el *HTMLElement) Close() error

func (*HTMLElement) Compare

func (el *HTMLElement) Compare(other core.Value) int64

func (*HTMLElement) Copy

func (el *HTMLElement) Copy() core.Value

func (*HTMLElement) CountBySelector

func (el *HTMLElement) CountBySelector(ctx context.Context, selector drivers.QuerySelector) (values.Int, error)

func (*HTMLElement) ExistsBySelector

func (el *HTMLElement) ExistsBySelector(ctx context.Context, selector drivers.QuerySelector) (values.Boolean, error)

func (*HTMLElement) Focus

func (el *HTMLElement) Focus(ctx context.Context) error

func (*HTMLElement) FocusBySelector

func (el *HTMLElement) FocusBySelector(ctx context.Context, selector drivers.QuerySelector) error

func (*HTMLElement) GetAttribute

func (el *HTMLElement) GetAttribute(ctx context.Context, name values.String) (core.Value, error)

func (*HTMLElement) GetAttributes

func (el *HTMLElement) GetAttributes(ctx context.Context) (*values.Object, error)

func (*HTMLElement) GetChildNode

func (el *HTMLElement) GetChildNode(ctx context.Context, idx values.Int) (core.Value, error)

func (*HTMLElement) GetChildNodes

func (el *HTMLElement) GetChildNodes(ctx context.Context) (*values.Array, error)

func (*HTMLElement) GetIn

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

func (*HTMLElement) GetInnerHTML

func (el *HTMLElement) GetInnerHTML(ctx context.Context) (values.String, error)

func (*HTMLElement) GetInnerHTMLBySelector

func (el *HTMLElement) GetInnerHTMLBySelector(ctx context.Context, selector drivers.QuerySelector) (values.String, error)

func (*HTMLElement) GetInnerHTMLBySelectorAll

func (el *HTMLElement) GetInnerHTMLBySelectorAll(ctx context.Context, selector drivers.QuerySelector) (*values.Array, error)

func (*HTMLElement) GetInnerText

func (el *HTMLElement) GetInnerText(ctx context.Context) (values.String, error)

func (*HTMLElement) GetInnerTextBySelector

func (el *HTMLElement) GetInnerTextBySelector(ctx context.Context, selector drivers.QuerySelector) (values.String, error)

func (*HTMLElement) GetInnerTextBySelectorAll

func (el *HTMLElement) GetInnerTextBySelectorAll(ctx context.Context, selector drivers.QuerySelector) (*values.Array, error)

func (*HTMLElement) GetNextElementSibling added in v0.13.0

func (el *HTMLElement) GetNextElementSibling(ctx context.Context) (core.Value, error)

func (*HTMLElement) GetNodeName

func (el *HTMLElement) GetNodeName(ctx context.Context) (values.String, error)

func (*HTMLElement) GetNodeType

func (el *HTMLElement) GetNodeType(ctx context.Context) (values.Int, error)

func (*HTMLElement) GetParentElement added in v0.13.0

func (el *HTMLElement) GetParentElement(ctx context.Context) (core.Value, error)

func (*HTMLElement) GetPreviousElementSibling added in v0.13.0

func (el *HTMLElement) GetPreviousElementSibling(ctx context.Context) (core.Value, error)

func (*HTMLElement) GetStyle

func (el *HTMLElement) GetStyle(ctx context.Context, name values.String) (core.Value, error)

func (*HTMLElement) GetStyles

func (el *HTMLElement) GetStyles(ctx context.Context) (*values.Object, error)

func (*HTMLElement) GetValue

func (el *HTMLElement) GetValue(ctx context.Context) (core.Value, error)

func (*HTMLElement) Hash

func (el *HTMLElement) Hash() uint64

func (*HTMLElement) Hover

func (el *HTMLElement) Hover(ctx context.Context) error

func (*HTMLElement) HoverBySelector

func (el *HTMLElement) HoverBySelector(ctx context.Context, selector drivers.QuerySelector) error

func (*HTMLElement) Input

func (el *HTMLElement) Input(ctx context.Context, value core.Value, delay values.Int) error

func (*HTMLElement) InputBySelector

func (el *HTMLElement) InputBySelector(ctx context.Context, selector drivers.QuerySelector, value core.Value, delay values.Int) error

func (*HTMLElement) Iterate

func (el *HTMLElement) Iterate(_ context.Context) (core.Iterator, error)

func (*HTMLElement) Length

func (el *HTMLElement) Length() values.Int

func (*HTMLElement) MarshalJSON

func (el *HTMLElement) MarshalJSON() ([]byte, error)

func (*HTMLElement) Press added in v0.15.0

func (el *HTMLElement) Press(ctx context.Context, keys []values.String, count values.Int) error

func (*HTMLElement) PressBySelector added in v0.15.0

func (el *HTMLElement) PressBySelector(ctx context.Context, selector drivers.QuerySelector, keys []values.String, count values.Int) error

func (*HTMLElement) QuerySelector

func (el *HTMLElement) QuerySelector(ctx context.Context, selector drivers.QuerySelector) (core.Value, error)

func (*HTMLElement) QuerySelectorAll

func (el *HTMLElement) QuerySelectorAll(ctx context.Context, selector drivers.QuerySelector) (*values.Array, error)

func (*HTMLElement) RemoteID added in v0.16.0

func (el *HTMLElement) RemoteID() runtime.RemoteObjectID

func (*HTMLElement) RemoveAttribute

func (el *HTMLElement) RemoveAttribute(ctx context.Context, names ...values.String) error

func (*HTMLElement) RemoveStyle

func (el *HTMLElement) RemoveStyle(ctx context.Context, names ...values.String) error

func (*HTMLElement) ScrollIntoView

func (el *HTMLElement) ScrollIntoView(ctx context.Context, options drivers.ScrollOptions) error

func (*HTMLElement) Select

func (el *HTMLElement) Select(ctx context.Context, value *values.Array) (*values.Array, error)

func (*HTMLElement) SelectBySelector

func (el *HTMLElement) SelectBySelector(ctx context.Context, selector drivers.QuerySelector, value *values.Array) (*values.Array, error)

func (*HTMLElement) SetAttribute

func (el *HTMLElement) SetAttribute(ctx context.Context, name, value values.String) error

func (*HTMLElement) SetAttributes

func (el *HTMLElement) SetAttributes(ctx context.Context, attrs *values.Object) error

func (*HTMLElement) SetIn

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

func (*HTMLElement) SetInnerHTML

func (el *HTMLElement) SetInnerHTML(ctx context.Context, innerHTML values.String) error

func (*HTMLElement) SetInnerHTMLBySelector

func (el *HTMLElement) SetInnerHTMLBySelector(ctx context.Context, selector drivers.QuerySelector, innerHTML values.String) error

func (*HTMLElement) SetInnerText

func (el *HTMLElement) SetInnerText(ctx context.Context, innerText values.String) error

func (*HTMLElement) SetInnerTextBySelector

func (el *HTMLElement) SetInnerTextBySelector(ctx context.Context, selector drivers.QuerySelector, innerText values.String) error

func (*HTMLElement) SetStyle

func (el *HTMLElement) SetStyle(ctx context.Context, name, value values.String) error

func (*HTMLElement) SetStyles

func (el *HTMLElement) SetStyles(ctx context.Context, styles *values.Object) error

func (*HTMLElement) SetValue

func (el *HTMLElement) SetValue(ctx context.Context, value core.Value) error

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

func (el *HTMLElement) WaitForAttribute(
	ctx context.Context,
	name values.String,
	value core.Value,
	when drivers.WaitEvent,
) error

func (*HTMLElement) WaitForAttributeBySelector added in v0.16.0

func (el *HTMLElement) WaitForAttributeBySelector(ctx context.Context, selector drivers.QuerySelector, name values.String, value core.Value, when drivers.WaitEvent) error

func (*HTMLElement) WaitForAttributeBySelectorAll added in v0.16.0

func (el *HTMLElement) WaitForAttributeBySelectorAll(ctx context.Context, selector drivers.QuerySelector, name values.String, value core.Value, when drivers.WaitEvent) error

func (*HTMLElement) WaitForClass

func (el *HTMLElement) WaitForClass(ctx context.Context, class values.String, when drivers.WaitEvent) error

func (*HTMLElement) WaitForClassBySelector added in v0.16.0

func (el *HTMLElement) WaitForClassBySelector(ctx context.Context, selector drivers.QuerySelector, class values.String, when drivers.WaitEvent) error

func (*HTMLElement) WaitForClassBySelectorAll added in v0.16.0

func (el *HTMLElement) WaitForClassBySelectorAll(ctx context.Context, selector drivers.QuerySelector, class values.String, when drivers.WaitEvent) error

func (*HTMLElement) WaitForElement added in v0.16.0

func (el *HTMLElement) WaitForElement(ctx context.Context, selector drivers.QuerySelector, when drivers.WaitEvent) error

func (*HTMLElement) WaitForElementAll added in v0.16.0

func (el *HTMLElement) WaitForElementAll(ctx context.Context, selector drivers.QuerySelector, when drivers.WaitEvent) error

func (*HTMLElement) WaitForStyle

func (el *HTMLElement) WaitForStyle(ctx context.Context, name values.String, value core.Value, when drivers.WaitEvent) error

func (*HTMLElement) WaitForStyleBySelector added in v0.16.0

func (el *HTMLElement) WaitForStyleBySelector(ctx context.Context, selector drivers.QuerySelector, name values.String, value core.Value, when drivers.WaitEvent) error

func (*HTMLElement) WaitForStyleBySelectorAll added in v0.16.0

func (el *HTMLElement) WaitForStyleBySelectorAll(ctx context.Context, selector drivers.QuerySelector, name values.String, value core.Value, when drivers.WaitEvent) error

func (*HTMLElement) XPath

func (el *HTMLElement) XPath(ctx context.Context, expression values.String) (result core.Value, err error)

type Manager

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

func New

func New(
	logger zerolog.Logger,
	client *cdp.Client,
	mouse *input.Mouse,
	keyboard *input.Keyboard,
) (manager *Manager, err error)

func (*Manager) AddFrame

func (m *Manager) AddFrame(frame page.FrameTree)

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) GetFrameNode

func (m *Manager) GetFrameNode(ctx context.Context, frameID page.FrameID) (*HTMLDocument, error)

func (*Manager) GetFrameNodes

func (m *Manager) GetFrameNodes(ctx context.Context) (*values.Array, error)

func (*Manager) GetFrameTree

func (m *Manager) GetFrameTree(_ context.Context, frameID page.FrameID) (page.FrameTree, error)

func (*Manager) GetMainFrame

func (m *Manager) GetMainFrame() *HTMLDocument

func (*Manager) LoadDocument added in v0.16.0

func (m *Manager) LoadDocument(ctx context.Context, frame page.FrameTree) (*HTMLDocument, error)

func (*Manager) LoadRootDocument added in v0.16.0

func (m *Manager) LoadRootDocument(ctx context.Context) (*HTMLDocument, error)

func (*Manager) RemoveFrame

func (m *Manager) RemoveFrame(frameID page.FrameID) error

func (*Manager) RemoveFrameRecursively

func (m *Manager) RemoveFrameRecursively(frameID page.FrameID) error

func (*Manager) RemoveFramesByParentID

func (m *Manager) RemoveFramesByParentID(parentFrameID page.FrameID) error

func (*Manager) ResolveElement added in v0.16.0

func (m *Manager) ResolveElement(ctx context.Context, frameID page.FrameID, id runtime.RemoteObjectID) (*HTMLElement, error)

func (*Manager) SetMainFrame

func (m *Manager) SetMainFrame(doc *HTMLDocument)

type NodeLoader added in v0.16.0

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

func (*NodeLoader) Load added in v0.16.0

Jump to

Keyboard shortcuts

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