1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

yahoo mail creator need help

Discussion in 'Visual Basic .NET' started by atom6402, Jan 1, 2010.

  1. atom6402

    atom6402 Junior Member

    Joined:
    Aug 17, 2009
    Messages:
    111
    Likes Received:
    85
    hi i have coded a yahoo mail creator
    and everything works fine

    the form gets filled automaticaly but i fail on the last step
    i couldn find any code to press the button "create my account"

    i have tested all the submition code like

    WebBrowser1.Document.Forms(0).InvokeMember("submit")

    but the site only refreshes :confused:

    maybe it is possible to find out the postion of the button and simulate a klick on that ?!?
     
  2. w84it

    w84it Regular Member

    Joined:
    Jun 18, 2009
    Messages:
    442
    Likes Received:
    752
    hmm i haven't tried this but here's a snippet.

    Code:
    
    for each el as htmlelement in WebBrowser1.Document.All
    if el.getattribute("id")="IAgreeBtn-rnd"
    el.invokemember("click")
    end if
    next
    
    
    Thats just a quick way, you can probably speed the process by going straigh to the element instead of looping through them all but whatever.
     
  3. atom6402

    atom6402 Junior Member

    Joined:
    Aug 17, 2009
    Messages:
    111
    Likes Received:
    85
    no its not possible to klick the button with code
    their is a protecion .. beacuse even in SEnuke you have to klick yourself on the button

    the only way is to find the position in the browser and simluate a klick there
    but i coultn find any code for that
     
  4. atom6402

    atom6402 Junior Member

    Joined:
    Aug 17, 2009
    Messages:
    111
    Likes Received:
    85
    ahhhh I FOUND THE CODE

    Code:
    Dim myHtmlElement As HtmlElement
            For Each myHtmlElement In WebBrowser1.Document.All
                If myHtmlElement.GetAttribute("name") = "IAgreeBtn" AndAlso _
                   myHtmlElement.GetAttribute("type") = "submit" Then
                    myHtmlElement.InvokeMember("Click")
                End If
            Next