2010-01-01 5 views

Répondre

2

Vous pouvez manipuler le DOM d'un document chargé à l'intérieur WebBrowser commande en obtenant une référence à un 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; 
     // ... 
    } 
} 
Questions connexes