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

Method siblings

pyquery/pyquery.py:514–524  ·  view source on GitHub ↗

>>> h = ' Hi Bye ' >>> d = PyQuery(h) >>> d('.hello').siblings() [ , ] >>> d('.hello').siblings('img') [ ]

(self, selector=None)

Source from the content-addressed store, hash-verified

512 return self._filter_only(selector, self._prev_all(), reverse=True)
513
514 def siblings(self, selector=None):
515 """
516 >>> h = '<span><p class="hello">Hi</p><p>Bye</p><img scr=""/></span>'
517 >>> d = PyQuery(h)
518 >>> d('.hello').siblings()
519 [<p>, <img>]
520 >>> d('.hello').siblings('img')
521 [<img>]
522
523 """
524 return self._filter_only(selector, self._prev_all() + self._next_all())
525
526 def parents(self, selector=None):
527 """

Callers

nothing calls this directly

Calls 3

_filter_onlyMethod · 0.95
_prev_allMethod · 0.95
_next_allMethod · 0.95

Tested by

no test coverage detected