Documentation
¶
Index ¶
- func AddAttribute(node *html.Node, key string, val string)
- func AppendAttribute(node *html.Node, key string, val string)
- func Attr(key string, val string) html.Attribute
- func CreateNode(data string, dataAtom atom.Atom, values ...interface{}) *html.Node
- func FindAllNodes(n *html.Node, all ...atom.Atom) []*html.Node
- func FindNode(n *html.Node, a atom.Atom) *html.Node
- func FindNodeWithAttributes(n *html.Node, a atom.Atom, attr map[string]string) *html.Node
- func FindNodes(n *html.Node, a atom.Atom) []*html.Node
- func FindNodesWithAttributes(n *html.Node, a atom.Atom, attr map[string]string) []*html.Node
- func GetAttribute(node *html.Node, key string) string
- func GetText(n *html.Node) string
- func HasAttributes(n *html.Node, attr map[string]string) bool
- func ReplaceAttribute(node *html.Node, key string, val string)
- func Text(text string) *html.Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAttribute ¶
AddAttribute adds an attribute to the node
func AppendAttribute ¶
AppendAttribute appends the new value to any existing attribute with the same name, separating them with a space
func CreateNode ¶
CreateNode creates an html Node and sets attributes or adds child nodes according to the type of each value
func FindAllNodes ¶
FindAllNodes returns all child nodes of any of the given types, in the order in which they are found (a depth-first search)
func FindNodeWithAttributes ¶
FindNodeWithAttributes is a depth-first search for the first node of the given type with the given attributes
func FindNodesWithAttributes ¶
FindNodesWithAttributes returns all child nodes of the given type with the given attributes
func GetAttribute ¶
GetAttribute finds an attribute for the node - returns empty string if not found
func GetText ¶
GetText returns the text content of the given node, including the text content of all child nodes. Extraneous newline characters are removed.
func HasAttributes ¶
HasAttributes returns true if the given node has all the attribute values
func ReplaceAttribute ¶
ReplaceAttribute adds an attribute to the node, replacing any existing attribute with the same name
Types ¶
This section is empty.