node

package
v0.0.0-...-eac5a05 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2018 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFn

func AllFn(okRes bool, filters ...func(*html.Node) bool) func(*html.Node) bool

AllFn gets a slice of filters and returns new filter func. This function calls each filter from the slice with given *html.Node and returns okRes if all filters return true otherwise this function returns !okRes.

func AnyFn

func AnyFn(okRes bool, filters ...func(*html.Node) bool) func(*html.Node) bool

AnyFn gets a slice of filters and returns new func. This function calls each filter from the slice with given *html.Node and returns okRes if any call of filter returns true. If all filters returns false this function returns !okRes.

func Attr

func Attr(n *html.Node, key string) (string, bool)

Attr returns attribute of node by given key if any.

func Children

func Children(n *html.Node, filter func(*html.Node) bool) []*html.Node

Children returns slice of nodes where each node is a child of given node and filter function returns true for corresponding child node.

func Find

func Find(n *html.Node, filter func(*html.Node) bool) *html.Node

Find walks through tree of nodes and call filter function for each one and returns node if filter returns true.

func JoinData

func JoinData(n ...*html.Node) string

JoinData returns attribute of node by given key if any.

func Traverse

func Traverse(n *html.Node, check func(*html.Node) bool, nodes []*html.Node) []*html.Node

Traverse walks through tree of nodes and adds visited node to the slice if check function returns true for this node.

Types

This section is empty.

Jump to

Keyboard shortcuts

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