title: How to pass a hidden recaptcha with mechanize?
body: <p>I am trying to complete a form on a website automatically for academic purposes using Python's mechanize.  </p>
  
  <p>When a human completes the form and submits it, there is no recaptcha.  </p>
  
  <p>But when I fill in the controls for the form via mechanize in Python, there is a hidden control that is a recaptcha apparently.  </p>
  
  <pre><code>&lt;HiddenControl(recaptcha_response_field=manual_challenge)&gt;
  </code></pre>
  
  <p>Since this recaptcha is never shown to a human, I don't know what it is looking for, or for that matter what a manual_challenge is.  </p>
  
  <p>Thus my question is, how can I pass this challenge so I can continue with automation / mechanize?  </p>
  
  <p>I've posted the script I've been using below, in case some fault lies with it.</p>
  
  <pre><code>import mechanize
  import re
  
  #constants
  TEXT = "hello world!"
  
  br = mechanize.Browser()
  #ignore robots.txt
  br.set_handle_robots(False)
  
  br.addheaders = [('User-agent', 'Firefox')]
  
  #open the page
  response = br.open("http://somewebsite.com")
  
  #this is the only form available 
  br.select_form("form2")
  
  br.form.set_all_readonly(False)
  
  cText = br.form.find_control("text")
  cText.value = TEXT
  
  #now submit our response
  response = br.submit()
  br.back()
  
  #verify the url for error checking
  print response.geturl()
  
  #print the data to a text file
  s = response.read()
  w = open("test.txt", 'w')
  print&gt;&gt;w, s
  w.close()
  </code></pre>