QuerySelectorAll searches all of the html.Node that matches the specified XPath selectors.
(top *html.Node, selector *xpath.Expr)
| 80 | |
| 81 | // QuerySelectorAll searches all of the html.Node that matches the specified XPath selectors. |
| 82 | func 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. |
| 94 | func LoadURL(url string) (*html.Node, error) { |
no test coverage detected
searching dependent graphs…