Reputation: 1570
So here is what I want to do to start off here is a simple sample HTML code
<html>
<body>
<b>This a test <br>ABCD</b>
</body>
</html>
So now how can I get only the text "This a test
"
I tried to do something like this "/html/body/b
" but I get "ABCD
" as the output? What can I do to get "This is a test
"?
Upvotes: 1
Views: 365
Reputation: 7993
The XPath expression could be:-
/html/body/b[1]
This may provide you the string "This a test
".
Hope it helps.
Upvotes: 1