|
-
Aug 21st, 2012, 02:06 PM
#1
Thread Starter
New Member
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
-
Aug 21st, 2012, 02:21 PM
#2
Re: Can't click the button, web.
Try ...
webpageelement.InvokeMember("onclick")
It's not guranteed but it works occasionally.
-
Aug 21st, 2012, 02:26 PM
#3
Thread Starter
New Member
Re: Can't click the button, web.
-
Aug 21st, 2012, 02:29 PM
#4
Re: Can't click the button, web.
-
Aug 21st, 2012, 02:38 PM
#5
Thread Starter
New Member
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.
Last edited by kimsen; Aug 21st, 2012 at 03:42 PM.
-
Aug 23rd, 2012, 08:59 AM
#6
Thread Starter
New Member
Re: Can't click the button, web.
-
Aug 23rd, 2012, 10:19 AM
#7
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|