htmlquery

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 2 Imported by: 0

README

A library to query html content.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAllNodesRec

func FindAllNodesRec(n *html.Node, fn NodeMatcher) []*html.Node

func FindFirstNode

func FindFirstNode(n *html.Node, fn NodeMatcher) *html.Node

func FirstChildNodeText

func FirstChildNodeText(doc *html.Node) string

func GetAttrValue

func GetAttrValue(attributes []html.Attribute, key string) string

func ListChildren

func ListChildren(n *html.Node, matcher NodeMatcher) []*html.Node

func NodeHasAttr

func NodeHasAttr(n *html.Node, key string, matcher StringMatcher) bool

NodeHasAttr is deprecated, use HasAttr instead.

Types

type NodeMatcher

type NodeMatcher func(*html.Node) bool

func All

func All(matchers ...NodeMatcher) NodeMatcher

func Any

func Any(matchers ...NodeMatcher) NodeMatcher

func HasAttr

func HasAttr(key string, matcher StringMatcher) NodeMatcher

func HasTag

func HasTag(tag string) NodeMatcher

func IsTextNode

func IsTextNode() NodeMatcher

type StringMatcher

type StringMatcher func(string) bool

func StartingWith

func StartingWith(prefix string) StringMatcher

func StringIs

func StringIs(expected string) StringMatcher

Jump to

Keyboard shortcuts

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