I have a button in HTML as such:
<input id="accept” class="accept button" type="submit" name="authorize" value="Log in" style>
The code below not working.
HtmlElementCollection elc = this.webBrowser1.Document.GetElementsByTagName("input");
foreach (HtmlElement el in elc)
{
if (el.GetAttribute("type").Equals("submit"))
{
el.InvokeMember("Click");
}
}
I have also tried:
HtmlElementCollection classButton = webBrowser1.Document.All;
foreach (HtmlElement element in classButton)
{
if (element.GetAttribute("class").Contains("accept"))
{
element.InvokeMember("click");
}
}
But no success.