1

So say we needed to use authentication before we can actually access the web then:

import urllib2, base64
authenip = "10.203.10.12" #What ever the authenication ip is....
req = urllib2.Request("http://" + authenip)
base64string = base64.encodestring("username:password").replace("\n", "")
req.add_header("Authorization", "Basic %s" % base64string)
requested = urllib2.urlopen(req)

Alright but from here since we have now logged in, how do we go to a website?

Martijn Pieters
  • 963,270
  • 265
  • 3,804
  • 3,187
user3818650
  • 563
  • 1
  • 5
  • 19

0 Answers0