The login button on google.com!

trolol

Newbie
Joined
Jun 24, 2011
Messages
38
Reaction score
6
Hey broskis, I'm getting into webbrowser, I know it's noob, I know:)

But whenever my 'bot' clicks the login button it seems that it just 'highlights' the button, anyone? :)

Thanks!:)

EDIT:

So I've been trying that httpwebrequest thing now; and I came to this. Obviously the Email and Passwd are incorrect, but if I use my own account, why do I get that I ain't got any cookies? :) Help me?

Code:
Dim postData As String = "continue=https%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3D2&service=mail&rm=false&dsh=-4208908587536675652&ltmpl=default&ltmpl=default&scc=1&ss=1&GALX=4roZEZWMMQc&pstMsg=1&dnConn=https%3A%2F%2Faccounts.youtube.com&checkConnection=&checkedDomains=&timeStmp=&secTok=&Email=BHW&Passwd=lolol&signIn=Aanmelden&PersistentCookie=yes&rmShown=1"

        Dim tempCookies As New CookieContainer
        Dim encoding As New UTF8Encoding
        Dim byteData As Byte() = encoding.GetBytes(postData)

        Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("https:SLASHSLASHaccountsDOTgoogleDOTcomSLASHServiceLoginAuth"), HttpWebRequest)
        postReq.Method = "POST"
        postReq.KeepAlive = True
        postReq.CookieContainer = tempCookies
        postReq.ContentType = "application/x-www-form-urlencoded"
        postReq.Referer = "https:SLASHSLASHaccountsDOTgoogleDOTcomSLASHServiceLoginAuth"
        postReq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)"
        postReq.ContentLength = byteData.Length

        Dim postreqstream As Stream = postReq.GetRequestStream()
        postreqstream.Write(byteData, 0, byteData.Length)
        postreqstream.Close()
        Dim postresponse As HttpWebResponse

        postresponse = DirectCast(postReq.GetResponse(), HttpWebResponse)
        tempCookies.Add(postresponse.Cookies)
        logincookie = tempCookies
        Dim postreqreader As New StreamReader(postresponse.GetResponseStream())

        Dim thepage As String = postreqreader.ReadToEnd

        WebBrowser1.DocumentText = thepage
Had to be creative on the 'https:SLASHSLASHaccountsDOTgoogleDOTcomSLASHServiceLoginAuth' part :P
 
Last edited:
You can't login to Google this way, you must follow the exact process that Google follows of going to the login page, parsing the variables (dsh, GALX) and then POST the data, follow the CheckCookie page etc that Google sends you through.

Use Charles / Fiddler2 / Live HTTP Headers plugin for firefox to follow the exact requests that are made and then make your application do the same.
 
I followed that:) But It doesn't store the cookie I think:-)
 
I take it that you are replacing the GALX & DSH keys with the scraped keys? Also after submitting the page Google uses a Javascript redirect that you must follow. Make sure you are using the same cookie container throughout each call also.
 
Why dont you just start your browser at the google login page. Or instead of clicking the login button try to write some code that finds the instance that occurs before you need to click login and just have the browser navigate to google login.


For example!
Code:
Private sub timer1_tick(blahblahblah)
          If 'anything = 'anything Then
                    Webbrowser1.Navigate("www(dot)accounts(dot)google(dot)com/login")
                    Timer1.stop
          End If
End Sub
 
Back
Top