loginurl = 'https://www.4shared.com/login?login=%s&password=%s' % (username, password) resp = opener.open(loginurl) #save the cookie.