Parsing HTML data from a webpage - the htmlelementcollection does not recognize the Table tag within the Form tag.


i have custom application uses javascript , renders information in webpage. in attempt parse html obtain text content, got structure of body.innertext below.

<form>

<table>

<tr><td/><tr/>

<tr><table>text interested in </table></tr>

</table>

</form>

when use htmlelementcollection, can form tag, <table> within not recognized child. doing wrong? child count returned 0 in code below.

htmlelementcollection elemcoll = null;    htmldocument doc = webbrowser1.document;    if (doc != null)  {      elemcoll = doc.getelementsbytagname("form");      foreach (htmlelement element in elemcoll)      {        messagebox.show(element.children.count.tostring());        htmlelementcollection tabelecoll = doc.getelementsbytagname("table");      }  }

thanks in advance!

you mean “innerhtml” instead of “innertext”. otherwise simple text, not html table. can check value of element.innerhtml? should include <table>.



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user