Reputation: 409
<p><span class="label">key</span>value</p>
How am I able to get just the "value" out using xPath? I managed to get to the element using the following expression:
//span[@class='label']/..
Upvotes: 1
Views: 40
Reputation: 14145
You just have to use text() to get the text from the p
//span[@class='label']/../text()
Upvotes: 0
Reputation: 4869
Try this one to get required value:
//p[span[@class='label']]/text()
Upvotes: 2