I'm trying to get data from table cells in a web page through the WebBrowser control in C# 2005. Below are some codes I used:
HtmlDocument doc = WebBrowser1.Document;
HtmlElementCollection tables = doc.GetElementsByTagName("table");
if (tables.Count > 0)
System.Web.UI.HtmlControls.HtmlTable table = tables as System.Web.UI.HtmlControls.HtmlTable; //can't work
As known, tables is treated as HtmlElement and C# doesn't allow me to convert this HtmlElement to an HtmlTable object. But I really hope I can use the easy functions from HtmlTable such as Rows and Cells to get data much faster and easier.
Is there a way for me to get data from the html table cells using the functions similar like HtmlTable?