Open mmair2011 opened 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))') []
Not ideal, but there's d('p').not_(':has(b)')
d('p').not_(':has(b)')
It should return p tags without b tag.