Skip to content Skip to sidebar Skip to footer

Xpath Expression To Select Nodes Based On Presence Of Child Node?

I'm trying to use Xpath to find all
s with a given CSS class (.product).

Solution 1:

Solution 2:

Use this XPath:

//div[@class="product" and not(img[@alt="sold out"])]

Solution 3:

you are making a small mistake it should be

//div[@class="product"]/img [ @alt!="sold out"]

Post a Comment for "Xpath Expression To Select Nodes Based On Presence Of Child Node?"