In [ ]:
import urllib.request
In [ ]:
with urllib.request.urlopen('http://www.python.org/') as r:
print(type(r))
print(r.status, r.reason)
for h in r.getheaders():
print(h)
print(r.readline())
In [ ]: