How would I go about selecting only the week number in this h3 and not the span tag inside it?
Selecting just the H3 including the span results in some ascii text being added to the resulting messagebox.
Result:
 Week 1
Source document:
<h3>
<span> </span>Week 1</h3>
Code:
private void getWeekNumber(string url)
{
HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
htmlDoc.Load(new System.IO.StringReader(url));
foreach (HtmlAgilityPack.HtmlNode h3 in htmlDoc.DocumentNode.SelectNodes("//h3"))
{
MessageBox.Show(h3.InnerText);
}
}