Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 655

New Post: Extract data from an HTML form using HTML Agility pack

$
0
0

m trying to list all nodes in the HTML form  dynamically using HTML agility pack, meaning that I don't know the names of the Attributes and the input names. The problem is when I want to get the label corresponding to each input.

<form name="input" action="html_form_action.asp" method="get">
Username: <input type="text" name="user" />
<input type="submit" value="Submit" />
</form>

Username  Input"user"

So here I want to write Username then the input, it seems really obvious in this example but sometimes they're not direct siblings, there would be many hidden inputs, or other tags.

Another example:

   <input type=hidden name="startDate">

     
<TR>  <TD bgColor=#008088 colSpan=2 class="headfont">

       
<FONT color=#FFFFFF>  <B>* Enter ur username and password</B> </FONT>

     
</TD></TR>

     
<TR>

       
<TD bgColor=#9ccdcd class="datafont"><FONT color=black>Username</FONT></TD>

           
<TD bgColor=#9ccdcd class="datafont">

           
<INPUT tabIndex=1 name=stuNum

              autocomplete
="off" size="20"></TD></TR>

         
<TR>

Am using C# winforms in my project .

I have few ideas but they will take lots of time,so I thought since am new to HTML agility pack there would be a way or some shortcut to get it,,,Any suggestions?



Viewing all articles
Browse latest Browse all 655


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>