0

I am trying out python's Requests library, because python's Mechanize library didn't work for me.

I got the Request to work, but I don't know how to check whether or the the login attempt was successful or not, the script just loads and then nothing shows up, just blank screen.

import requests
from requests.auth import HTTPDigestAuth

site = "http://MyRouter'sSite"

try:
    requests.get(site, auth=HTTPDigestAuth('admin', 'password'))
except requests.exceptions.HTTPError:
    print "Error"
Casimir Crystal
  • 18,651
  • 14
  • 55
  • 76
Mohamed
  • 21
  • 3

0 Answers0