MCPcopy Create free account
hub / github.com/antchfx/htmlquery / QuerySelectorAll

Function QuerySelectorAll

query.go:82–91  ·  view source on GitHub ↗

QuerySelectorAll searches all of the html.Node that matches the specified XPath selectors.

(top *html.Node, selector *xpath.Expr)

Source from the content-addressed store, hash-verified

80
81// QuerySelectorAll searches all of the html.Node that matches the specified XPath selectors.
82func QuerySelectorAll(top *html.Node, selector *xpath.Expr) []*html.Node {
83 var elems []*html.Node
84 t := selector.Select(CreateXPathNavigator(top))
85 for t.MoveNext() {
86 nav := t.Current().(*NodeNavigator)
87 n := getCurrentNode(nav)
88 elems = append(elems, n)
89 }
90 return elems
91}
92
93// LoadURL loads the HTML document from the specified URL. Default enabling gzip on a HTTP request.
94func LoadURL(url string) (*html.Node, error) {

Callers 1

QueryAllFunction · 0.85

Calls 3

CreateXPathNavigatorFunction · 0.85
getCurrentNodeFunction · 0.85
CurrentMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…