Documentation ¶
Overview ¶
Package htmlutil provides various utility functions for working with HTML nodes.
Index ¶
- func GetAllHtmlNodes(n *html.Node, tag string, attr string, attrValue string) []*html.Node
- func GetFirstHtmlNode(n *html.Node, tag string, attr string, attrValue string) *html.Node
- func GetHtmlNodes(n *html.Node, tag string, attr string, attrValue string, count int) []*html.Node
- func HtmlNodeToString(n *html.Node) (string, error)
- func RemoveAllHtmlAttrs(n *html.Node, tag string, attr string, attrValue string)
- func RemoveAllHtmlNodes(n *html.Node, tag string, attr string, attrValue string)
- func RemoveFirstHtmlAttr(n *html.Node, tag string, attr string, attrValue string)
- func RemoveFirstHtmlNode(n *html.Node, tag string, attr string, attrValue string)
- func RemoveHtmlAttrs(node *html.Node, tag string, attr string, attrValue string, count int)
- func RemoveHtmlNodes(n *html.Node, tag string, attr string, attrValue string, count int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllHtmlNodes ¶
GetAllHtmlNodes is a convenience function for GetHtmlNodes() that returns all matching HTML nodes.
func GetFirstHtmlNode ¶
GetFirstHtmlNode is a convenience function for GetHtmlNodes() that returns the first matching node.
func GetHtmlNodes ¶
GetHtmlNodes returns the HTML nodes found within the provided node given a tag, attribute, and attribute value up to the provided count.
The tag, attribute, and attribute value are all optional. If they are empty, they will not be used as search criteria.
If the count is -1, all nodes will be returned.
func HtmlNodeToString ¶
HtmlNodeToString converts an HTML node to a string for easier printing.
func RemoveAllHtmlAttrs ¶
RemoveAllHtmlAttrs is a convenience function for RemoveHtmlAttrs() that removes all matching attributes.
func RemoveAllHtmlNodes ¶
RemoveAllHtmlNodes is a convenience function for RemoveHtmlNodes() that removes all matching HTML nodes.
func RemoveFirstHtmlAttr ¶
RemoveFirstHtmlAttr is a convenience function for RemoveHtmlAttrs() that removes the first matching attribute.
func RemoveFirstHtmlNode ¶
RemoveFirstHtmlNode is a convenience function for RemoveHtmlNodes() that removes the first matching node.
func RemoveHtmlAttrs ¶
RemoveHtmlAttrs removes HTML attributes matching the provided tag, attribute, and value up to the provided count.
Tag is optional. If no tag is provided, all attributes matching the attribute and value will be removed.
If the count is -1, all attributes meeting the criteria will be removed.
func RemoveHtmlNodes ¶
RemoveHtmlNodes removes the HTML nodes found within the provided node given a tag, attribute, and attribute value up to the provided count.
The tag, attribute, and attribute value are all optional. If they are empty, they will not be used as search criteria.
If the count is -1, all nodes meeting the criteria will be removed.
Types ¶
This section is empty.