As is often the case, I’m struggling with the lack of proper lxml documentation (note to self: should write a proper lmxl tutorial and get lots of traffic!).
I want to find all <li> items that do not contain an <a> tag with a particular class.
For example:
<ul>
<li><small>pudding</small>: peaches and <a href="/cream">cream</a></li>
<li><small>cheese</small>: Epoisses and <a href="/st-marcellin" class="new">St Marcellin</a></li>
</ul>
I’d like to get hold of only the <li> that does not contain a link with class new, and I’d like to get hold of the text inside <small>. In other words, ‘pudding’.
Can anyone help?
thanks!
The XPath has the following meaning: