Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NodePath ¶
NodePath returns all the ancestors of node n, including itself as a string slice.
The nodes will be reconstructed into valid html.
func QuerySelector ¶
QuerySelector generates a query selector for the given html node.
func Reconstruct ¶
Reconstruct returns the html string used to generate the node n.
The text nodes associated with n will not be considered.
func SingleSelector ¶
SingleSelector generates a query selector for an html node. The result will not contain paths.
Types ¶
type Query ¶
Query represents an html element. It is used for finding matches in a document.
func NewQuery ¶
NewQuery parses a single html element and returns a Query instance.
Input must be a valid html element optionally wrapped with <>. If <> are prsent, they must be the first and the last characters respectively.
func (*Query) FindIn ¶
FindIn returns all the nodes matching the Query q.
It's the callers responsibility to ensure that the document is a valid utf-8 encoded string.