This will help you log in to one site and load the page, for example:
import mechanize
br=mechanize.Browser()
br.open('http://www.yourfavoritesite.com')
br.select_form(nr=0)
br['Username']='Username'
br['Password']='Password'
br.submit()
br.retrieve('https://www.yourfavoritesite.com/pagetoretrieve.html','yourfavoritepage.html')
This script assumes your login form is the first page, and your input names are Usernameand Password.
You can also select your form by name:
br.select_form(name="thisthing")
, script .
AlexMartelli, script .