htmlutil

package
v0.0.0-...-5254df5 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsoluteUrl

func AbsoluteUrl(href, base string) string

func Any

func Any(els []string, el string, match func(string, string) bool) bool

func Attr

func Attr(node *html.Node, key string) string

func Closest

func Closest(node *html.Node, sel string) *html.Node

func ExtractText

func ExtractText(content string) string

func FindNodes

func FindNodes(node *html.Node, match func(*html.Node) bool) []*html.Node

func HTML

func HTML(node *html.Node) string

func InnerHTML

func InnerHTML(node *html.Node) string
func IsAPossibleLink(val string) bool

func Query

func Query(node *html.Node, sel string) []*html.Node

func Text

func Text(node *html.Node) string

func TruncateText

func TruncateText(input string, size int) string

func URLDomain

func URLDomain(val string) string

Types

type ElementMatch

type ElementMatch struct {
	Name string
}

func (ElementMatch) Match

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

type Matcher

type Matcher interface {
	Match(*html.Node) bool
}

func NewMatcher

func NewMatcher(sel string) Matcher

type MultiMatch

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

func (*MultiMatch) Add

func (m *MultiMatch) Add(matcher Matcher)

func (MultiMatch) Match

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

Jump to

Keyboard shortcuts

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