Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7063881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:45:58+00:00 2026-05-28T04:45:58+00:00

This is my first experience in programming with Python and I’m trying to log

  • 0

This is my first experience in programming with Python and I’m trying to log in to this
webpage. After searching around I found that many people suggested using mechanize. Just to be sure that I setup things correctly before I get to code I downloaded the mechanize zip from the website and had my python script in the unzipped mechanize folder.

I have this code so far using different examples I’ve found:

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()

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 IDLE I get a bunch of errors including a time out error and a robot error. The full traceback:
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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:45:59+00:00Added an answer on May 28, 2026 at 4:45 am

    The problem is that Mechanize is respecting the robots.txt

    You must turn it off.

    Solution:

    mech = mechanize.Browser()
    // needs to be set before you call open
    mech.set_handle_robots(False)
    

    Edit: it appears that the site is using some sort of additional POST values
    that are generated via Javascript. This maybe a pain to recreate yourself, check the source of the page to see what’s going on.
    Actual POST values being sent:

    challenge   [a14b1f67-11edcc01]
    charset UTF-8
    login   Login
    origurl /Login/
    password    
    savedpw 0
    sha1    3f77d1e8c2ab0470ef8005a85f5f9c0d7aeedba6
    userid  sdsads
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, I dont have any experience with programming. If I ever start, then this
this is my first web-programming experience so I hope my questions doesn't sound very
This is my first experience using the Zend Framework. I am attempting to follow
This is my first experience with javascript, and... Well... Ugh. Here's what's happening: function
problem euler #5 i found the solution but i don't know why this first
I'm developing a win32 app in the C Programming Language. This is my first
I have a very limited experience of database programming and my applications that access
What is most important at this time? I know that I can acquire programming
I am trying to learn rails from zero programming experience and have an app
I am new to programming for the iPhone and this will be my first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.