MCPcopy Create free account
hub / github.com/antchfx/xmlquery / FindEach

Function FindEach

query.go:129–133  ·  view source on GitHub ↗

FindEach searches the html.Node and calls functions cb. Important: this method is deprecated, instead, use for .. = range Find(){}.

(top *Node, expr string, cb func(int, *Node))

Source from the content-addressed store, hash-verified

127// FindEach searches the html.Node and calls functions cb.
128// Important: this method is deprecated, instead, use for .. = range Find(){}.
129func FindEach(top *Node, expr string, cb func(int, *Node)) {
130 for i, n := range Find(top, expr) {
131 cb(i, n)
132 }
133}
134
135// FindEachWithBreak functions the same as FindEach but allows to break the loop
136// by returning false from the callback function `cb`.

Callers 1

TestXPathFunction · 0.85

Calls 1

FindFunction · 0.85

Tested by 1

TestXPathFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…