Documentation
¶
Index ¶
- func ConvertSimpleXpathToCssSelector(xpath string) string
- func EnhancedCssSelectorForElement(element *DOMElementNode, includeDynamicAttributes bool) string
- type ClickableElementProcessor
- type CoordinateSet
- type Coordinates
- type DOMBaseNode
- type DOMElementNode
- func (n *DOMElementNode) ClickableElementsToString(includeAttributes []string) string
- func (n *DOMElementNode) GetAllTextTillNextClickableElement(maxDepth int) string
- func (n *DOMElementNode) GetFileUploadElement(checkSiblings bool) *DOMElementNode
- func (n *DOMElementNode) Hash() HashedDomElement
- func (n *DOMElementNode) SetParent(parent *DOMElementNode)
- func (n *DOMElementNode) ToJson() map[string]any
- func (n *DOMElementNode) ToString() string
- type DOMHistoryElement
- type DOMState
- type DOMTextNode
- type DomService
- type ElementTreeSerializer
- type HashedDomElement
- type HistoryTreeProcessor
- func (h HistoryTreeProcessor) CompareHistoryElementAndDomeElement(domHistoryElement *DOMHistoryElement, domElement *DOMElementNode) bool
- func (h HistoryTreeProcessor) ConvertDomElementToHistoryElement(domElement *DOMElementNode) *DOMHistoryElement
- func (h HistoryTreeProcessor) FindHistoryElementInTree(domHistoryElement *DOMHistoryElement, tree *DOMElementNode) *DOMElementNode
- type SelectorMap
- type ViewportInfo
- type ViewportShortInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnhancedCssSelectorForElement ¶
func EnhancedCssSelectorForElement(element *DOMElementNode, includeDynamicAttributes bool) string
Types ¶
type ClickableElementProcessor ¶
type ClickableElementProcessor struct { }
func (*ClickableElementProcessor) GetClickableElements ¶
func (c *ClickableElementProcessor) GetClickableElements(node *DOMElementNode) []*DOMElementNode
func (*ClickableElementProcessor) GetClickableElementsHashes ¶
func (c *ClickableElementProcessor) GetClickableElementsHashes(node *DOMElementNode) []string
func (*ClickableElementProcessor) HashDomElement ¶
func (c *ClickableElementProcessor) HashDomElement(domElement *DOMElementNode) string
type CoordinateSet ¶
type CoordinateSet struct { TopLeft Coordinates `json:"topLeft"` TopRight Coordinates `json:"topRight"` BottomLeft Coordinates `json:"bottomLeft"` BottomRight Coordinates `json:"bottomRight"` Center Coordinates `json:"center"` Width int `json:"width"` Height int `json:"height"` }
func (*CoordinateSet) ToDict ¶
func (c *CoordinateSet) ToDict() map[string]any
type Coordinates ¶
func (*Coordinates) ToDict ¶
func (c *Coordinates) ToDict() map[string]int
type DOMBaseNode ¶
type DOMBaseNode interface { ToJson() map[string]any SetParent(parent *DOMElementNode) }
Base interface for all DOM nodes
type DOMElementNode ¶
type DOMElementNode struct { TagName string `json:"tagName"` Xpath string `json:"xpath"` Attributes map[string]string `json:"attributes"` Children []DOMBaseNode `json:"children"` IsInteractive bool `json:"isInteractive"` IsTopElement bool `json:"isTopElement"` IsInViewport bool `json:"isInViewport"` ShadowRoot bool `json:"shadowRoot"` HighlightIndex *int `json:"highlightIndex,omitempty"` ViewportCoordinates *CoordinateSet `json:"viewportCoordinates"` PageCoordinates *CoordinateSet `json:"pageCoordinates"` ViewportInfo *ViewportInfo `json:"viewportInfo"` Parent *DOMElementNode `json:"parent"` IsVisible bool `json:"isVisible"` IsNew *bool `json:"isNew,omitempty"` }
DOMElementNode
func (*DOMElementNode) ClickableElementsToString ¶
func (n *DOMElementNode) ClickableElementsToString(includeAttributes []string) string
func (*DOMElementNode) GetAllTextTillNextClickableElement ¶
func (n *DOMElementNode) GetAllTextTillNextClickableElement(maxDepth int) string
func (*DOMElementNode) GetFileUploadElement ¶
func (n *DOMElementNode) GetFileUploadElement(checkSiblings bool) *DOMElementNode
func (*DOMElementNode) Hash ¶
func (n *DOMElementNode) Hash() HashedDomElement
func (*DOMElementNode) SetParent ¶
func (n *DOMElementNode) SetParent(parent *DOMElementNode)
func (*DOMElementNode) ToJson ¶
func (n *DOMElementNode) ToJson() map[string]any
func (*DOMElementNode) ToString ¶
func (n *DOMElementNode) ToString() string
type DOMHistoryElement ¶
type DOMHistoryElement struct { TagName string `json:"tagName"` Xpath string `json:"xpath"` HighlightIndex *int `json:"highlightIndex,omitempty"` EntireParentBranchPath []string `json:"entireParentBranchPath"` Attributes map[string]string `json:"attributes"` ShadowRoot bool `json:"shadowRoot"` CssSelector *string `json:"cssSelector,omitempty"` PageCoordinates *CoordinateSet `json:"pageCoordinates"` ViewportCoordinates *CoordinateSet `json:"viewportCoordinates"` ViewportInfo *ViewportInfo `json:"viewportInfo"` }
func (*DOMHistoryElement) ToDict ¶
func (e *DOMHistoryElement) ToDict() map[string]any
type DOMState ¶
type DOMState struct { ElementTree *DOMElementNode `json:"elementTree"` SelectorMap *SelectorMap `json:"selectorMap"` }
type DOMTextNode ¶
type DOMTextNode struct { Text string `json:"text"` Type string `json:"type"` // default: TEXT_NODE Parent *DOMElementNode `json:"parent"` IsVisible bool `json:"isVisible"` }
DOMTextNode
func (*DOMTextNode) HasParentWithHighlightIndex ¶
func (n *DOMTextNode) HasParentWithHighlightIndex() bool
func (*DOMTextNode) IsParentInViewport ¶
func (n *DOMTextNode) IsParentInViewport() bool
func (*DOMTextNode) IsParentTopElement ¶
func (n *DOMTextNode) IsParentTopElement() bool
func (*DOMTextNode) SetParent ¶
func (n *DOMTextNode) SetParent(parent *DOMElementNode)
func (*DOMTextNode) ToJson ¶
func (n *DOMTextNode) ToJson() map[string]any
type DomService ¶
type DomService struct { Page playwright.Page `json:"page"` XpathCache map[string]any `json:"xpathCache"` JsCode string `json:"jsCode"` }
func NewDomService ¶
func NewDomService(page playwright.Page) *DomService
func (*DomService) GetClickableElements ¶
func (*DomService) GetCrossOriginIframes ¶
func (s *DomService) GetCrossOriginIframes() []string
type ElementTreeSerializer ¶
type ElementTreeSerializer struct{}
Serialization helpers
func (ElementTreeSerializer) DomElementNodeToJson ¶
func (ElementTreeSerializer) DomElementNodeToJson(elementTree *DOMElementNode) map[string]interface{}
func (ElementTreeSerializer) SerializeClickableElements ¶
func (ElementTreeSerializer) SerializeClickableElements(elementTree *DOMElementNode) string
type HashedDomElement ¶
type HistoryTreeProcessor ¶
type HistoryTreeProcessor struct { }
func (HistoryTreeProcessor) CompareHistoryElementAndDomeElement ¶
func (h HistoryTreeProcessor) CompareHistoryElementAndDomeElement(domHistoryElement *DOMHistoryElement, domElement *DOMElementNode) bool
func (HistoryTreeProcessor) ConvertDomElementToHistoryElement ¶
func (h HistoryTreeProcessor) ConvertDomElementToHistoryElement(domElement *DOMElementNode) *DOMHistoryElement
func (HistoryTreeProcessor) FindHistoryElementInTree ¶
func (h HistoryTreeProcessor) FindHistoryElementInTree(domHistoryElement *DOMHistoryElement, tree *DOMElementNode) *DOMElementNode
type ViewportInfo ¶
type ViewportInfo struct { ScrollX int `json:"scrollX"` ScrollY int `json:"scrollY"` Width int `json:"width"` Height int `json:"height"` }
func (*ViewportInfo) ToDict ¶
func (v *ViewportInfo) ToDict() map[string]int
type ViewportShortInfo ¶
Click to show internal directories.
Click to hide internal directories.