passman.add_password(None, theurl, username, password)
authhandler = urllib.request.HTTPBasicAuthHandler(passman)
opener = urllib.request.build_opener(authhandler)
urllib.request.install_opener(opener)
pagehandle = urllib.request.urlopen(theurl)
HTTPS log in with urllib2