<div class="one">
<a class="two" href="Something..."><img src="http://..."/></a>
<p> stuff.... </p>
<p><img src="http://....." /></p>
</div>
I have this silly HTML which I am parsing, as you can see there is one main class called one and another one nested called two.
I am trying to parse all the images in class one, but apparently the XPath I have is only catching one image, which is the image from class one
I tried this:
//div[@class="one"]/img | //a[@class="two"]/img
But apparently I am not catching from class two, but only from class one is there anyway to do this?
I am using lxml.html’s xpath feature.
Try this
Xpathexpression :Test :
OUTPUT