Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { // ID is an arbitrary value that is primarily used for distinguishing a node's // place within a sequence, such as a NodeList. ID int // Name is synonymous with an html tag or goquery.NodeName. Name string // Data represents the string data contained within an html node. Data string // Class represents the optional class attribute of an html node. Class string }
Node represents an html node within a document.
type NodeList ¶
NodeList represents a collection of Nodes with an arbitrary identifier.
func CollectionSiblings ¶
CollectionSiblings identifies arbitrary collections of HTML nodes from a datasource and returns the contents of both the identified collections and their inferred siblings.
An arbitrary collection of nodes could be [b, a, d] from a table organized as [a, b, c, d].
Furthermore, with three collections of nodes in tables sharing parent p...
p |> [a1, b1, c1, d1] |> [a2, b2, c2, c2] |> [a3, b3, c3, d3]
... and the two arbitrary collections are given...
[b1, a1, d1] [b2, a2, d2]
...the values returned will be:
[b1, a1, d1] [b2, a2, d2] [b3, a3, d3]
Had the third table not been the child of p, its nodes would not have been inferred as a sibling.
Each searchGroups subarray should contain a group of values expected to be within a shared structure, such as a table or table row.
Value order as given will be maintained, regardless of how the associated nodes are organized in the datasource.
type Route ¶
Route represents a unidirectional series of steps connecting two nodes.
func (Route) AppendRoute ¶
AppendRoute appends the Steps field of a to the Step field of the caller.
func (Route) LastNodeInRoute ¶
LastNodeInRoute returns the node resulting from navigating the caller's Steps from the caller's Start node.