i need to read data from a web browser and add some of this data to my database. data is in web browser table.
+2
A:
You can manipulate the DOM of a document loaded inside WebBrowser control by obtaining a reference to an HtmlElement:
if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)
{
// find the table by id
HtmlElement table = webBrowser1.Document.GetElementById("id_of_the_table");
// use the table to extract data from columns and rows
foreach (HtmlElement rowElem in table.GetElementsByTagName("TR"))
{
string html = rowElem.InnerHtml;
// ...
}
}
Darin Dimitrov
2010-01-01 09:31:25