Reputation: 227
the html is like this:
<div id='id'>
<a href>abc</a>
"xyz"
</div>
I want to use xpath to get the xyz (I use it in capybara), but my xpath can't work
... //div[@id='id'].text
it returns abcxyz
how can I get it?
Upvotes: 0
Views: 148
Reputation: 4033
Text is its own text node, so the correct selector would be:
.//div[@id='id']/text()
Upvotes: 1