xquery: github.com/antchfx/xquery/html Index | Files

package htmlquery

import "github.com/antchfx/xquery/html"

Package htmlquery provides extract data from HTML documents using XPath expression.

Index

Package Files

query.go

func Find Uses

func Find(top *html.Node, expr string) []*html.Node

Find searches the html.Node that matches by the specified XPath expr.

func FindEach Uses

func FindEach(top *html.Node, expr string, cb func(int, *html.Node))

FindEach searches the html.Node and calls functions cb.

func FindOne Uses

func FindOne(top *html.Node, expr string) *html.Node

FindOne searches the html.Node that matches by the specified XPath expr, and returns first element of matched html.Node.

func InnerText Uses

func InnerText(n *html.Node) string

InnerText returns the text between the start and end tags of the object.

func LoadURL Uses

func LoadURL(url string) (*html.Node, error)

LoadURL loads the HTML document from the specified URL.

func OutputHTML Uses

func OutputHTML(n *html.Node, self bool) string

OutputHTML returns the text including tags name.

func Parse Uses

func Parse(r io.Reader) (*html.Node, error)

Parse returns the parse tree for the HTML from the given Reader.

func SelectAttr Uses

func SelectAttr(n *html.Node, name string) (val string)

SelectAttr returns the attribute value with the specified name.

type NodeNavigator Uses

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

func CreateXPathNavigator Uses

func CreateXPathNavigator(top *html.Node) *NodeNavigator

CreateXPathNavigator creates a new xpath.NodeNavigator for the specified html.Node.

func (*NodeNavigator) Copy Uses

func (h *NodeNavigator) Copy() xpath.NodeNavigator

func (*NodeNavigator) Current Uses

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

func (*NodeNavigator) LocalName Uses

func (h *NodeNavigator) LocalName() string

func (*NodeNavigator) MoveTo Uses

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

func (*NodeNavigator) MoveToChild Uses

func (h *NodeNavigator) MoveToChild() bool

func (*NodeNavigator) MoveToFirst Uses

func (h *NodeNavigator) MoveToFirst() bool

func (*NodeNavigator) MoveToNext Uses

func (h *NodeNavigator) MoveToNext() bool

func (*NodeNavigator) MoveToNextAttribute Uses

func (h *NodeNavigator) MoveToNextAttribute() bool

func (*NodeNavigator) MoveToParent Uses

func (h *NodeNavigator) MoveToParent() bool

func (*NodeNavigator) MoveToPrevious Uses

func (h *NodeNavigator) MoveToPrevious() bool

func (*NodeNavigator) MoveToRoot Uses

func (h *NodeNavigator) MoveToRoot()

func (*NodeNavigator) NodeType Uses

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

func (*NodeNavigator) Prefix Uses

func (*NodeNavigator) Prefix() string

func (*NodeNavigator) String Uses

func (h *NodeNavigator) String() string

func (*NodeNavigator) Value Uses

func (h *NodeNavigator) Value() string

Package htmlquery imports 7 packages (graph) and is imported by 8 packages. Updated 2017-10-23. Refresh now. Tools for package owners.