views:

24

answers:

1

Hello

I want to write a crawler in Java which logins to gmail account automatically. My crawler will take login Id and Password and will login to email account and displays the output page. I don't have clear idea as to how do I do this. I have tried to post some data to a blog with HTTP client So i am familiar with basic GET and POST methods of it.

Can anybody tell me how do I write crawler to login to a gmail email account? Any response will be appreciated.

Thanks in advance.

A: 

You could just look up the post-parameters you need.

Url: https://www.google.com/accounts/ServiceLoginAuth

The source for the login-form of gmail:

<form id="gaia_universallogin"
      action="https://www.google.com/accounts/ServiceLoginAuth" method="post"
      onsubmit="return(gaia_onLoginSubmit());">
  <input type="hidden" name="continue" id="continue"
           value="https://mail.google.com/mail/?ui=html&amp;amp;zy=l" />
  <input type="hidden" name="service" id="service"
           value="mail" />
  <input type="hidden" name="rm" id="rm"
           value="false" />
  <input type="hidden" name="dsh" id="dsh"
           value="-4518095010699607103" />
  <input type="hidden" name="ltmpl" id="ltmpl"
           value="default" />
  <input type="hidden" name="hl" id="hl"
           value="en" />
  <input type="hidden" name="ltmpl" id="ltmpl"
           value="default" />
  <input type="hidden" name="scc" id="scc"
           value="1" />

  <input type="hidden" name="ss" id="ss"
           value="1" />
  <input type="hidden" name="ltmpl" id="ltmpl"
           value="default" />
  <input type="hidden" name="ltmplcache" id="ltmplcache"
           value="2" />
</form>
Kurt Du Bois