title: Using mechanize to login to a webpage
body: <p>This is my first experience in programming with Python and I'm trying to log in to <a href="http://voyager.umeres.maine.edu/Login" rel="nofollow noreferrer">this</a>
  webpage. After searching around I found that many people suggested using <code>mechanize</code>. Just to be sure that I setup things correctly before I get to code I downloaded the <code>mechanize</code> zip from the website and had my python script in the unzipped mechanize folder.</p>
  
  <p>I have this code so far using different examples I've found:</p>
  
  <pre><code>import mechanize
  
  theurl = 'http://voyager.umeres.maine.edu/Login'
  mech = mechanize.Browser()
  mech.open(theurl)
  
  mech.select_form(nr=0)
  mech["userid"] = "MYUSERNAME"
  mech["password"] = "MYPASSWORD"
  results = mech.submit().read()
  
  f = file('test.html', 'w')
  f.write(results) 
  f.close()
  </code></pre>
  
  <p>From looking at the source of the webpage I believe the userid/password are the correct names for the form. When I run the script in <code>IDLE</code> I get a bunch of errors including a time out error and a robot error. The full traceback:
  <img src="https://i.stack.imgur.com/GspjI.png" alt="enter image description here">
   I'm not exactly sure what I should expect either even if the code works. The login is for my school email which has class folders as well. My end game for what i'm  trying to accomplish is once I log into my account I wanted to parse some folders for information and store them in a file that can be later converted in to json or RSS feed, but this is much further down the road with a much better understanding of Python just trying to give a more clear idea of what I want to accomplish.</p>