title: Trying to login to quora using mechanize
body: <p>I'm trying to use <code>mechanize</code> module to login to quora.com.</p>
  
  <p>This is my code:</p>
  
  <pre><code>#!/usr/bin/env python
  
  import mechanize
  import cookielib
  
  br = mechanize.Browser() # create a browser object
  br.set_handle_equiv(True)
  br.set_handle_redirect(True)
  br.set_handle_referer(True)
  br.set_handle_robots(False)
  br.set_headers = [('User-Agent', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)')]
  
  cj = cookielib.LWPCookieJar()
  br.set_cookiejar(cj)
  
  res = br.open('http://www.quora.com')
  br.select_form(nr = 0)
  
  br.form['email'] = 'uuuu'
  br.form['password'] = 'pppp'
  
  res = br.submit()
  print res.read()
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "mech.py", line 29, in &lt;module&gt;
      res = br.submit()
    File "/usr/local/lib/python2.7/dist-packages/mechanize/_mechanize.py", line 541, in submit
      return self.open(self.click(*args, **kwds))
    File "/usr/local/lib/python2.7/dist-packages/mechanize/_mechanize.py", line 203, in open
      return self._mech_open(url, data, timeout=timeout)
    File "/usr/local/lib/python2.7/dist-packages/mechanize/_mechanize.py", line 255, in _mech_open
      raise response
  mechanize._response.httperror_seek_wrapper: HTTP Error 500: Internal Server Error
  </code></pre>
  
  <p>I know that HTTP 500 means there is something wrong server-side, but I have no idea what it is, and how I can debug the issue.</p>