parser

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisableSelectorCache = false
View Source
var SelectorCacheMaxEntries = 50

Functions

This section is empty.

Types

type NodeNavigator

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

func CreateXPathNavigator

func CreateXPathNavigator(top *html.Node) *NodeNavigator

func (*NodeNavigator) Copy

func (*NodeNavigator) Current

func (h *NodeNavigator) Current() *html.Node

func (*NodeNavigator) LocalName

func (h *NodeNavigator) LocalName() string

func (*NodeNavigator) MoveTo

func (h *NodeNavigator) MoveTo(other AXpath.NodeNavigator) bool

func (*NodeNavigator) MoveToChild

func (h *NodeNavigator) MoveToChild() bool

func (*NodeNavigator) MoveToFirst

func (h *NodeNavigator) MoveToFirst() bool

func (*NodeNavigator) MoveToNext

func (h *NodeNavigator) MoveToNext() bool

func (*NodeNavigator) MoveToNextAttribute

func (h *NodeNavigator) MoveToNextAttribute() bool

func (*NodeNavigator) MoveToParent

func (h *NodeNavigator) MoveToParent() bool

func (*NodeNavigator) MoveToPrevious

func (h *NodeNavigator) MoveToPrevious() bool

func (*NodeNavigator) MoveToRoot

func (h *NodeNavigator) MoveToRoot()

func (*NodeNavigator) NodeType

func (h *NodeNavigator) NodeType() AXpath.NodeType

func (*NodeNavigator) Prefix

func (*NodeNavigator) Prefix() string

func (*NodeNavigator) String

func (h *NodeNavigator) String() string

func (*NodeNavigator) Value

func (h *NodeNavigator) Value() string

type XpathNode

type XpathNode html.Node

func XpathParser

func XpathParser(body *string) *XpathNode

func (*XpathNode) ExistsAttr

func (x *XpathNode) ExistsAttr(name string) bool

ExistsAttr returns whether attribute with specified name exists.

func (*XpathNode) Find

func (x *XpathNode) Find(expr string) []*XpathNode

func (*XpathNode) FindOne

func (x *XpathNode) FindOne(expr string) *XpathNode

func (*XpathNode) HTML

func (x *XpathNode) HTML(self bool) string

HTML returns the text including tags name.

func (*XpathNode) Query

func (x *XpathNode) Query(expr string) (*XpathNode, error)

func (*XpathNode) QueryAll

func (x *XpathNode) QueryAll(expr string) ([]*XpathNode, error)

func (*XpathNode) QuerySelector

func (x *XpathNode) QuerySelector(selector *AXpath.Expr) *XpathNode

QuerySelector returns the first matched html.Node by the specified XPath selector.

func (*XpathNode) QuerySelectorAll

func (x *XpathNode) QuerySelectorAll(selector *AXpath.Expr) []*XpathNode

func (*XpathNode) SelectAttr

func (x *XpathNode) SelectAttr(name string) (val string)

func (*XpathNode) Text

func (x *XpathNode) Text() string

Jump to

Keyboard shortcuts

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