I am trying to read HTML source using webbrowser control in C#.
The HTML source contains the following line:
input class=”myclass” name=”commit” type=”submit” value=”Submit”
I am trying to read the above by using following code:
HtmlElementCollection buttonElement = webBrowser1.Document.GetElementsByTagName("commit");
But it doesn’t return any element. I printed buttonElement.Count value and it prints 0.
When I right click in webbrowser control and view source then I can see this element “commit” is there and there is no other element by this name.
It’s tag name is
input. Therefore your code should be something like this