I want to get the text of an html page using a simple application in c#? If there are nested elements ie.,
<Table>
<TR>
<TD>**ABC**
</TD>
<TD>**1**
</TD>
</TR>
<TR>
<TD>**XYZ**
</TD>
<TD>**2**
</TD>
</TR>
</Table>
How can I get the text(bold) directly values.I want to save them in my database and also want to show in gridview?
HtmlDocument htmlSnippet = new HtmlDocument();
htmlSnippet = LoadHtmlSnippetFromFile();
private HtmlDocument LoadHtmlSnippetFromFile()
{
//TextReader reader = File.OpenText(Server.MapPath("~/App_Data/HtmlSnippet.txt"));
WebClient webClient = new WebClient();
const string strUrl = "http://www.dsebd.org/latest_PE_all2_08.php";
Stream reader = webClient.OpenRead(strUrl);
HtmlDocument doc = new HtmlDocument();
doc.Load(reader);
reader.Close();
return doc;
}
From this htmlSnippet
how could i get the value?