Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib.request
- url = 'http://3link1/'
- username = 'admin'
- password = 'admin'
- p = urllib.request.HTTPPasswordMgrWithDefaultRealm()
- p.add_password(None, url, username, password)
- handler = urllib.request.HTTPBasicAuthHandler(p)
- opener = urllib.request.build_opener(handler)
- urllib.request.install_opener(opener)
- page = urllib.request.urlopen(url).read()
- page1 = bytes.decode(page)
- print(page1)
Add Comment
Please, Sign In to add comment