XPath Help - Code for getting data before "<br>" Tag
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 thi开发者_运维技巧s "/html/body/b
" but I get "ABCD
" as the output? What can I do to get "This is a test
"?
The XPath expression could be:-
/html/body/b[1]
This may provide you the string "This a test
".
Hope it helps.
精彩评论