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

Function FindOne

query.go:41–47  ·  view source on GitHub ↗

FindOne is like Query but will panics if the expression `expr` cannot be parsed. See `Query()` function.

(top *html.Node, expr string)

Source from the content-addressed store, hash-verified

39// FindOne is like Query but will panics if the expression `expr` cannot be parsed.
40// See `Query()` function.
41func FindOne(top *html.Node, expr string) *html.Node {
42 node, err := Query(top, expr)
43 if err != nil {
44 panic(err)
45 }
46 return node
47}
48
49// QueryAll searches the html.Node that matches by the specified XPath expr.
50// Return an error if the expression `expr` cannot be parsed.

Callers 4

TestNavigatorFunction · 0.85
TestXPathFunction · 0.85
TestXPathCdUpFunction · 0.85
TestConcurrentQueryFunction · 0.85

Calls 1

QueryFunction · 0.85

Tested by 4

TestNavigatorFunction · 0.68
TestXPathFunction · 0.68
TestXPathCdUpFunction · 0.68
TestConcurrentQueryFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…