This is the button I'm trying to click:
<td class="dark" onclick="document.getElementById('id').value = '0'; document.getElementById('form').submit()">
test
</td>
I tried this code that uses the Winform WebBrowser control to click on that element:
HtmlElementCollection links = webBrowser1.Document.Links;
foreach (HtmlElement link in links)
{
if ((link.InnerText != null) && (link.InnerText.Equals("test")))
link.InvokeMember("Click");
}
It clicks links but not on buttons like the one I posted above. I tried different things like this as well:
if (curElement.GetAttribute("id").Equals("0"))
{
curElement.InvokeMember("click");
}
What is the correct way to click that table cell from the WebBrowser control?