Reputation: 151
I am trying to write an XPath to pull the value 4.4690 from the tag below. Any help will be appreciated.
<div id=currency_converter_result>10 BRL = <span class=bld>4.4690 USD</span>
<input type=submit value="Convert">
</div>
Upvotes: 1
Views: 82
Reputation: 474161
Find the span's text and use substring-before()
to extract the part of a text before the USD
:
substring-before(//div[@id="currency_converter_result"]/span[@class="bld"], " USD")
Upvotes: 4