gawel / pyquery

A jquery-like library for python
http://pyquery.rtfd.org/
Other
2.3k stars 182 forks source link

'p:has(b)' returns incorrect value #166

Open mmair2011 opened 7 years ago

mmair2011 commented 7 years ago

It should return p tags without b tag.


>>> from pyquery import PyQuery as pq
>>> ahtml='''
<html>
<p>pa</p>
<p>pb<b>b1</b></p>
<p>pc<b>b2</b></p>
<p>pd</p>
<p>pe</p>
</html>
'''
>>> d=pq(ahtml)
>>> d('p:not(:has(b))')
[]
ghost commented 7 years ago

Not ideal, but there's d('p').not_(':has(b)')