MCPcopy Create free account
hub / github.com/PuerkitoBio/goquery / RemoveFiltered

Method RemoveFiltered

manipulation.go:253–255  ·  view source on GitHub ↗

RemoveFiltered removes from the current set of matched elements those that match the selector filter. It returns the Selection of removed nodes. For example if the selection s contains " ", " " and " " and s.RemoveFiltered("h2") is called, only the " " node is removed (and returned), wh

(selector string)

Source from the content-addressed store, hash-verified

251// and s.RemoveFiltered("h2") is called, only the "<h2>" node is removed
252// (and returned), while "<h1>" and "<h3>" are kept in the document.
253func (s *Selection) RemoveFiltered(selector string) *Selection {
254 return s.RemoveMatcher(compileMatcher(selector))
255}
256
257// RemoveMatcher removes from the current set of matched elements those that
258// match the Matcher filter. It returns the Selection of removed nodes.

Callers 1

TestRemoveFilteredFunction · 0.80

Calls 2

RemoveMatcherMethod · 0.95
compileMatcherFunction · 0.85

Tested by 1

TestRemoveFilteredFunction · 0.64