I have a button, but I can’t find the code to click it.
Maybe it’s a Java button or something, but this is the information about it:
<div class="contractLink">
<button class="build" onclick="window.location.href = 'dorf1.php?a=17&c=ad65e8'; return false;" value="الارتقاء الى مستوى 2" type="button">
</div>
Please tell me how can I do this. I have tried:
HtmlElement ele = webBrowser1.Document.GetElementById("name");
if (ele != null)
But there is no id.
Assuming you don’t control the HTML, you will have to use
GetElementsByTagNameto get all buttons and find the one you need.If there is only one button then it’s simple matter of:
Otherwise you can iterate the buttons and find the proper one according to its value.