Copying table contents from a webpage into .txt file with C#.Net


hi everybody

i want copy table contents webpage .txt file c#.net.

how can windowsformapplication in visual c#.net?

thank you

 


new ideas, superior solutions www.salamgroup.net

hi,

you can use webbrowser control this.

you have to go through each  tr , td find exact value.  example.

  htmldocument document = webbrowser.document;   if (document != null && outerhtml !=null)                  {                                          htmlelementcollection tablecollection = document.getelementsbytagname("table");                      foreach (htmlelement table in tablecollection)                      {  							htmlelementcollection trcoll = table.getelementsbytagname("tr");  							 foreach (htmlelement row in trcoll)                               {  								htmlelementcollection tds = row.getelementsbytagname("td");  								 if (tds != null && tds.count > 1)                                      {  									string texttoextract = tds[0].innertext;                                          if ((texttoextract.indexof("hellothisisanil", stringcomparison.invariantcultureignorecase) == -1)  										{  											//store extracted  value variable ,   write text file streamwriter.  										}  									}  						     }  					}  				}  

i think it  helpful you.


software developer


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