I've seen some results on StackOverflow already on a similar topic and they all recommended the HTML Agility Pack. I've also found a few examples on it too, but it isn't working. My current code:
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml("http://stackoverflow.com/");
List<string> facts = new List<string>();
foreach (HtmlNode li in doc.DocumentNode.SelectNodes("//div"))
{
facts.Add(li.InnerText);
foreach (String s in facts)
{
textBox1.Text += s + "/n";
}
}
I get the error Null reference was unhandled on doc.DocumentNode.SelectNodes("//div").
Also, as another question, how do I find a specific div with a name?