FindOne is like Query but will panics if the expression `expr` cannot be parsed. See `Query()` function.
(top *html.Node, expr string)
| 39 | // FindOne is like Query but will panics if the expression `expr` cannot be parsed. |
| 40 | // See `Query()` function. |
| 41 | func 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. |
searching dependent graphs…