html

package
v0.0.0-...-04eba25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DocumentFromUrl

func DocumentFromUrl(urlRef string) (*goquery.Document, error)

DocumentFromUrl builds a goquery.Document from urlRef.

func HtmlNodeGrepAttr

func HtmlNodeGrepAttr(node *html.Node, attrName string, reg *regexp.Regexp) string

HtmlNodeGrepAttr greps value of given attrName with reg. If attr value does not match reg, return an empty string. If reg is nil, use strings.Contains to match attr value.

func NodeContainsText

func NodeContainsText(node *html.Node, text string) bool

NodeContainsText checks whether node contains text.

func NodeGrepAllHref

func NodeGrepAllHref(node *html.Node) []string

NodeGrepAllHref greps all href inside node and its children.

func NodeGrepHref

func NodeGrepHref(node *html.Node, reg *regexp.Regexp) string

NodeGrepHref greps a href link that matches regexp in node. Return link when regexp is nil.

func NodeSearchAttr

func NodeSearchAttr(node *html.Node, attrName string) string

NodeSearchAttr searches html node, find attr's value and return.

func NodeSearchAttrEq

func NodeSearchAttrEq(node *html.Node, attrName string, attrValue string) bool

NodeSearchAttrEq searches html node, find attr's value equal to attrValue in node. If found, return true, otherwise return false.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL