dq

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Document Query - A simple HTML Document query library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHref

func GetHref(n *html.Node) string

func HasChild

func HasChild(n *html.Node, pattern string) bool

func InnerText

func InnerText(n *html.Node, recurse bool) string

func RawInnerText

func RawInnerText(n *html.Node, recurse bool) string

func Traverse

func Traverse(n *html.Node, ms []Matcher)

Types

type MatchFunc

type MatchFunc func(*html.Node) bool

func NewMatchFunc

func NewMatchFunc(pattern string) MatchFunc

type MatchHandlerFunc

type MatchHandlerFunc func(*html.Node)

type Matcher

type Matcher interface {
	Match(n *html.Node) bool
	Handler(n *html.Node)
	SubMatchers() []Matcher
}

type NodeMatcher

type NodeMatcher struct {
	// contains filtered or unexported fields
}

func NewNodeMatcher

func NewNodeMatcher(
	matchFunc MatchFunc,
	handler MatchHandlerFunc,
	children ...Matcher,
) *NodeMatcher

func (*NodeMatcher) Handler

func (m *NodeMatcher) Handler(n *html.Node)

func (*NodeMatcher) Match

func (m *NodeMatcher) Match(n *html.Node) bool

func (*NodeMatcher) SubMatchers

func (m *NodeMatcher) SubMatchers() []Matcher

Jump to

Keyboard shortcuts

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