HTML code:
<b> CAR </b>
<br></br>
Car is something you can drive.
<br></br>
<br></br>
C# code:
HtmlAgilityPack.HtmlDocument doc = new HtmlWeb().Load("http://website.com/x.html");
if (doc != null)
{
HtmlNode link = doc.DocumentNode.SelectSingleNode("//b[contains(text(), 'CAR')]");
webBrowser1.DocumentText = link.InnerText;
webBrowser1.AllowNavigation = true;
webBrowser1.ScriptErrorsSuppressed = true;
webBrowser1.Visible = true;
}
What I manage to get: CAR
I need to get:
CAR
Car is something you can drive.
Any suggestions? I have tried adding next nodes, but it I gave NullReferenceExceptions : "//b[contains(text(), 'CAR')/br]" and "//b[contains(text(), 'CAR')/br/br]"
Thanks in advance. PS.I Would like to avoid Regex..