MCPcopy Create free account
hub / github.com/gawel/pyquery / not_

Method not_

pyquery/pyquery.py:624–633  ·  view source on GitHub ↗

Return elements that don't match the given selector: >>> d = PyQuery(' Hi Bye ') >>> d('p').not_('.hello') [ ]

(self, selector)

Source from the content-addressed store, hash-verified

622 return self._copy(elements, parent=self)
623
624 def not_(self, selector):
625 """Return elements that don't match the given selector:
626
627 >>> d = PyQuery('<p class="hello">Hi</p><p>Bye</p><div></div>')
628 >>> d('p').not_('.hello')
629 [<p>]
630 """
631 exclude = set(self._copy(selector, self))
632 return self._copy([e for e in self if e not in exclude],
633 parent=self)
634
635 def is_(self, selector):
636 """Returns True if selector matches at least one current element, else

Callers 1

test_notMethod · 0.80

Calls 1

_copyMethod · 0.95

Tested by 1

test_notMethod · 0.64