title: Python: web login script, what's the problem?
body: <p>this is the script >></p>
  
  <pre><code>import ClientForm
  import urllib2
  request = urllib2.Request("http://ritaj.birzeit.edu")
  
  response = urllib2.urlopen(request)
  forms = ClientForm.ParseResponse(response, backwards_compat=False)
  response.close()
  
  form = forms[0]
  print form
  sooform = str(raw_input("Form Name: "))
  username = str(raw_input("Username: "))
  password = str(raw_input("Password: "))
  
  form[sooform] = [username, password]
  
  request2 = form.click()
  try:
      response2 = urllib2.urlopen(request2)
  except urllib2.HTTPError, response2:
      pass
  
  print response2.geturl()
  print response2.info()  # headers
  print response2.read()  # body
  response2.close()
  </code></pre>
  
  <p>when start the script ,, i got this</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Python26/ritaj2.py", line 9, in &lt;module&gt;
      form = forms[0]
  IndexError: list index out of range
  </code></pre>
  
  <p>what is th problem,, i running on windows, python 2.6.4</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I want a script that login this site, and print the response :)</p>