html

package
v0.0.0-...-7b4befc Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHTTPStatusCodeNotOK = errors.New("HTTP status code is not OK")

Functions

func Attribute

func Attribute(node *html.Node, key string) (value string)

func BFS

func BFS(rootNode *html.Node, match MatchFunc) (node *html.Node)

BFS returns the node matching the match function and nil if no node is found.

func DirectChild

func DirectChild(parent *html.Node,
	matchFunc MatchFunc) (child *html.Node)

func DirectChildren

func DirectChildren(parent *html.Node,
	matchFunc MatchFunc) (children []*html.Node)

func Fetch

func Fetch(ctx context.Context, client *http.Client, url string) (
	rootNode *html.Node, err error)

func HasClassStrings

func HasClassStrings(node *html.Node, classStrings ...string) (match bool)

func WrapError

func WrapError(sentinelError error, node *html.Node) error

func WrapWarning

func WrapWarning(warning string, node *html.Node) string

Types

type MatchFunc

type MatchFunc func(node *html.Node) (match bool)

func MatchData

func MatchData(data string) MatchFunc

func MatchID

func MatchID(id string) MatchFunc

Jump to

Keyboard shortcuts

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