Documentation ¶
Overview ¶
Package htmlelements implements functions on parsed documents as returned by the golang.org/x/net/html package. These are patterned after the known JavaScript functions.
Index ¶
- func AddAttribute(n *html.Node, attrName, value string)
- func GetAttribute(n *html.Node, attrName string) string
- func GetElementByID(doc *html.Node, id string) *html.Node
- func GetElementsByClassName(doc *html.Node, className string) []*html.Node
- func GetElementsByTagName(doc *html.Node, tagName string) []*html.Node
- func InnerText(n *html.Node) (ret string)
- func RemoveAttribute(n *html.Node, attrName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAttribute ¶
AddAttribute adds the named attribute, if the attribute is already present, the value will be appended with a blank as delimiter
func GetAttribute ¶
GetAttribute searches the named attribute, returning the value or if not found an empty string.
func GetElementByID ¶
GetElementByID searches for the HTML element with the given id.
func GetElementsByClassName ¶
GetElementsByClassName searches the doc for all elements with the given class name.
func GetElementsByTagName ¶
GetElementsByTagName searches the doc for all elements with the given tag name.
func RemoveAttribute ¶
RemoveAttribute removes the named attribute.
Types ¶
This section is empty.