I'm having to use the webbrowser control in a small application to not fill in field values but the opposite extract them, what i am trying to do is grab the complete input string for example:
<input type="text" name="username" class="form-control" size="40" required="required"/>
I know by using:
foreach (HtmlElement element in webBrowser.Document.GetElementsByTagName("input"))
{
Helpers.ReturnMessage(element.GetAttribute("name"));
}
We can get the value of the name="username"
part by using the code above, but is there a way to get the entire string which in this case would be:
<input type="text" name="username" class="form-control" size="40" required="required"/>
Ideally what i am looking to do is grab this part from each input
-> name="username"
it could be id="value"
in some examples so i couldn't hard code it, or would i need to use regex of some kind? thank you for any help.