Reputation: 195
I'm trying to select a node whose children do not contain some specific text. For example:
<div class="b-margin">
<div class="tag">Pt</div>
<div class="tag">En</div>
</div>
<div class="b-margin">
<div class="tag">Ru</div>
<div class="tag">En</div>
</div>
How would i go about selecting the 'div class="b-margin"' nodes that do not have children with the text "Pt"?
Upvotes: 0
Views: 26
Reputation: 14145
Here is the simple xpath.
//div[@class='b-margin' and not(div[.='Pt'])]
Upvotes: 2