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

Function QueryAll

query.go:51–58  ·  view source on GitHub ↗

QueryAll searches the html.Node that matches by the specified XPath expr. Return an error if the expression `expr` cannot be parsed.

(top *html.Node, expr string)

Source from the content-addressed store, hash-verified

49// QueryAll searches the html.Node that matches by the specified XPath expr.
50// Return an error if the expression `expr` cannot be parsed.
51func QueryAll(top *html.Node, expr string) ([]*html.Node, error) {
52 exp, err := getQuery(expr)
53 if err != nil {
54 return nil, err
55 }
56 nodes := QuerySelectorAll(top, exp)
57 return nodes, nil
58}
59
60// Query runs the given XPath expression against the given html.Node and
61// returns the first matching html.Node, or nil if no matches are found.

Callers 1

FindFunction · 0.85

Calls 2

getQueryFunction · 0.85
QuerySelectorAllFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…