I have an HTML page as shown below. I need to take "blah blah blah" only from the "span" tag.
<span class="news"> blah blah blah <div>hello</div> <div>bye</div> </span>
This gives me all the meanings:
div.SelectSingleNode(".//span[@class='news']").InnerText.Trim();
This gives me null:
div.SelectSingleNode(".//span[@class='news']/preceding-sibling::text()").InnerText.Trim();
How to get text before div tag using HtmlAgilityPack?
source share