Match all elements that contain other elements:: >>> from pyquery import PyQuery >>> d = PyQuery(' title ') >>> d('h1:parent') [ ] ..
(self, xpath)
| 340 | return xpath |
| 341 | |
| 342 | def xpath_parent_pseudo(self, xpath): |
| 343 | """Match all elements that contain other elements:: |
| 344 | |
| 345 | >>> from pyquery import PyQuery |
| 346 | >>> d = PyQuery('<div><h1><span>title</span></h1><h1/></div>') |
| 347 | >>> d('h1:parent') |
| 348 | [<h1>] |
| 349 | |
| 350 | .. |
| 351 | """ |
| 352 | xpath.add_condition("count(child::*) > 0") |
| 353 | return xpath |
| 354 | |
| 355 | def xpath_empty_pseudo(self, xpath): |
| 356 | """Match all elements that do not contain other elements:: |
nothing calls this directly
no outgoing calls
no test coverage detected