I want to extract not the whole web-page but only text from one class, I haven't found how to do this for my code. I want text from td class="result-neutral" this is html code:
<td class="result-neutral" xseid="xz1nBfht"><a href="/hockey/russia/khl/ska-st-petersburg-metallurg-magnitogorsk-xz1nBfht/">3 - 2 </a></td>
Now I have sych a C# code(Info is the name of a textbox):
HtmlAgilityPack.HtmlDocument doc = new HtmlDocument();
HtmlWeb hw = new HtmlWeb();
doc = hw.Load("http://www.sportstats.com/hockey/russia/detail/ska-st-petersburg-zVJwe4ER/");
var nodes = doc.DocumentNode.Descendants("td");
string result = "";
foreach (var item in nodes)
{
result += item.InnerText+Environment.NewLine;
}
Info.Text = result;
}
To be honest, I'd better get the score, which in the example above is 3-2