dcsimg
Results 1 to 7 of 7

Thread: Can't click the button, web.

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    4

    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

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,242

    Re: Can't click the button, web.

    Try ...

    webpageelement.InvokeMember("onclick")

    It's not guranteed but it works occasionally.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    4

    Re: Can't click the button, web.

    It doesnt work:/

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,242

    Re: Can't click the button, web.

    What's the website?

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    4

    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    4

    Re: Can't click the button, web.

    No ideas?

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,502

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width