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

Odd Problem (Gmail Signup) w/ code

Discussion in 'Visual Basic .NET' started by Migladon, Sep 10, 2012.

  1. Migladon

    Migladon Regular Member

    Joined:
    May 16, 2009
    Messages:
    229
    Likes Received:
    135
    I am trying to automate filling in the gmail signup form and hitting the submit button. However, I am running into a strange issue. When I fill in all the fields on the form via my webbrowser control and hit the submit button I get the error message- "Sorry, we cannot serve your request for a new account at this moment." On the flipside if I fill in a couple fields manually I get a successful account creation. So I believe the gmail form is detecting that I am programmatically entering info rather than manually and thus rejecting it? I am scratching my head over this issue. Any help would be greatly appreciated.Here is the code- To get it to work fill in each STRINGHERE with corresponding info. Add webbrowser1 with url set to https://accounts.google.com/SignUp and add button with FillGmailPageOne() on click event.

    Code:
    [SIZE=2]Function FillGmailPageOne() As Action
    WebBrowser1.Document.GetElementById("FirstName").SetAttribute("Value","STRINGHERE")
    WebBrowser1.Document.GetElementById("LastName").SetAttribute("Value","STRINGHERE")
    WebBrowser1.Document.GetElementById("GmailAddress").SetAttribute("Value","STRINGHERE")
    WebBrowser1.Document.GetElementById("Passwd").SetAttribute("Value", "STRINGHERE")
    WebBrowser1.Document.GetElementById("PasswdAgain").SetAttribute("Value","STRINGHERE")
    WebBrowser1.Document.GetElementById("BirthMonth").SetAttribute("Value", 8)
    WebBrowser1.Document.GetElementById("BirthDay").SetAttribute("Value", 15)
    WebBrowser1.Document.GetElementById("BirthYear").SetAttribute("Value", 1987)
    WebBrowser1.Document.GetElementById("Gender").SetAttribute("Value", "MALE")
    WebBrowser1.Document.GetElementById("TermsOfService").InvokeMember("Click")
    Return Nothing
    End Function
    [/SIZE]

    -Migladon
     
    Last edited: Sep 10, 2012
  2. lincolnave

    lincolnave Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 5, 2008
    Messages:
    392
    Likes Received:
    184
    Occupation:
    Building Bots and Arduinos
    Location:
    Outside NYC
    Not sure if this helps , but I wrote a UBot bot to do this.

    PM if you want to chat.
     
  3. phatzilla

    phatzilla Jr. VIP Jr. VIP

    Joined:
    Apr 9, 2009
    Messages:
    1,382
    Likes Received:
    1,022
    If my memory serves me correct, Google account creation has mouseclick/keystroke detection which you'll need to emulate (or crack their protection) in order to create accounts. I think they use botguard
     
    Last edited: Sep 10, 2012
  4. Migladon

    Migladon Regular Member

    Joined:
    May 16, 2009
    Messages:
    229
    Likes Received:
    135
    Thanks for replies.

    Can someone run my code quick and see if they get the same results?

    I am going to try modifying it to use tab/keysend although I don't think this is the ideal solution. I will post back with results.

    Are there any other methods of inputting the text besides keysend and setting the element values?
     
    Last edited: Sep 10, 2012
  5. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,907
    Likes Received:
    1,938
    Home Page:
    Something like this?

    Code:
     ' Set First Name Field
                    WebBrowser1.Document.GetElementById("first_name").Focus()
                    WebBrowser1.Document.GetElementById("first_name").SetAttribute("value", "")
                    For i = 0 To (FirstName.Length() - 1)
                        WebBrowser1.Document.GetElementById("first_name").SetAttribute("value", WebBrowser1.Document.GetElementById("first_name").GetAttribute("value") & FirstName(i))
                    Next
    
     
    • Thanks Thanks x 1
  6. Shirko

    Shirko Junior Member

    Joined:
    Aug 11, 2012
    Messages:
    196
    Likes Received:
    172
    Location:
    adding monkeys to my papal
    Have you tried using .Value = "asdadas" instead of Focus, and SetAttribute?. I've a similar bot developed in vb6 and works fine for me.

    In the case you can't automatize this because gmail is detecting keystrokes you can do it smply using SendMessage API or other similar function to simulate keystrokes.
     
    • Thanks Thanks x 1
  7. Migladon

    Migladon Regular Member

    Joined:
    May 16, 2009
    Messages:
    229
    Likes Received:
    135
    SOLVED: First focus the field, then input the text using sendkeys with a delay in between each character. You must also put a delay between focusing the field and inputting the text (about 2 seconds). The delay was key.

    THANKS ALL SO MUCH!