I have following html in a file, I am loading this file into an HTMLDocument using HtmlAgilityPack.
The problem is that I only want to get Hello World! using XPath and not the inner text.
How do I achieve this?
<ul>
<li>
Hello world!
<ul>
<li>
Welcome to planet!
</li>
</ul>
</li>
</ul>
The XPath:
Should select the actual text “Hello World!”
You can then select the value of this node.
In use:
In essence, what this says is navigate to a ul node, select the first li, and then select the text() node.