Documentation
¶
Index ¶
- func FindNodeByID(node *html.Node, id string, maxDepth int) *html.Node
- func GetAttr(attributes []html.Attribute, attrName string) string
- func GetAttrMap(attributes []html.Attribute) map[string]string
- func GetNodeTextContent(node *html.Node) string
- func GetNumericAttrFromMapWithDefault(attrMap map[string]string, attrName string, def int64) int64
- func HasClass(attributes []html.Attribute, className string) bool
- func ResolveURL(baseURL *url.URL, relativeURL string) string
- func SkipTokenContents(tokenizer *html.Tokenizer, tokenType string) error
- func WalkNodesPreOrder(node *html.Node, walker func(*html.Node) bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindNodeByID ¶
FindNodeByID searches the tree rooted at "node" for a node with the "id" attribute with the specified value. Returns the node, or nil if no such node is found.
func GetAttrMap ¶
GetAttrMap returns a map of attributes by name.
func GetNodeTextContent ¶
GetNodeTextContent returns the text content of a node.
func GetNumericAttrFromMapWithDefault ¶
GetNumericAttrFromMapWithDefault parses an attribute to a number, and returns the value, or returns `def` if the value is not present or cannot be parsed.
func ResolveURL ¶
ResolveURL resolves a URL relative to a parsed URL. For example, calling `ResolveURL("http://foo.com/bar", "../baz")` would return "http://foo.com/baz".
func SkipTokenContents ¶
SkipTokenContents can be used when encountering a `html.StartTagToken` to read up until the matching `html.EndTagToken`, discarding everything in the middle.
Types ¶
This section is empty.