gosoup

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Type ErrorType
	// contains filtered or unexported fields
}

func (Error) Error

func (e Error) Error() string

type ErrorType

type ErrorType int
const (
	ErrUnableToParse ErrorType = iota
	ErrNodeElementEmpty
	ErrElementNotFound
	ErrNoNextSibling
	ErrNoPreviousSibling
	ErrNoNextElementSibling
	ErrNoPreviousElementSibling
)

type Root

type Root struct {
	Node  *html.Node
	Value string
	Error error
}

func HTMLParse

func HTMLParse(s string) (*Root, error)

func (Root) Attrs

func (r Root) Attrs() map[string]string

func (Root) Children

func (r Root) Children() []*Root

func (Root) Find

func (r Root) Find(args ...string) *Root

func (Root) FindAll

func (r Root) FindAll(args ...string) ([]*Root, error)

func (Root) FindAllStrict

func (r Root) FindAllStrict(args ...string) ([]*Root, error)

func (Root) FindNextElementSibling

func (r Root) FindNextElementSibling() *Root

func (Root) FindNextSibling

func (r Root) FindNextSibling() *Root

func (Root) FindPrevElementSibling

func (r Root) FindPrevElementSibling() *Root

func (Root) FindPrevSibling

func (r Root) FindPrevSibling() *Root

func (Root) FindStrict

func (r Root) FindStrict(args ...string) *Root

func (Root) FullText

func (r Root) FullText() string

func (Root) HTML

func (r Root) HTML() string

func (Root) Text

func (r Root) Text() string

Jump to

Keyboard shortcuts

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