Can't click the button, web.
Hi, i can't find the way to click this button im the webpage.
any ideas?
HTML Code:
<td class="dark" onclick="document.getElementById('ga_id').value = '3'; document.getElementById('gaform').submit()">ga videre</td>
I have tried this code, and some other.
Code:
Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
'value = "3"
For Each webpageelement As HtmlElement In allelements
If webpageelement.GetAttribute("value") = "3" Then
webpageelement.InvokeMember("click")
End If
Next
Re: Can't click the button, web.
Try ...
webpageelement.InvokeMember("onclick")
It's not guranteed but it works occasionally.
Re: Can't click the button, web.
Re: Can't click the button, web.
Re: Can't click the button, web.
Is it some codes that i can find the button with the id and use the value to press the right button?
it is 4 values, 0, 1, 2, 3 in the html.
Re: Can't click the button, web.
Re: Can't click the button, web.
this isn't the right comparison...
If webpageelement.GetAttribute("value") = "3" Then
That element doesn't have a value attribute set to 3... in fact it doesn't have a value attribute at all. the only thing that identifies it is the class attribute... but then any element could have that same class as well, so that's not a good marker.
In fact, there is nothing on that element that makes it uniquely identifiable... at all.
Also, it's not a button. It's a table cell.
What you might be able to do is mimic what the javascript code does in the onClick...
YOU find the element (using the getElementByID) ... setting it's value... THEN clicking it...
-tg