In [1]:
import urllib
In [2]:
print(type(urllib))
In [3]:
print(urllib)
In [4]:
# print(urllib.error)
# AttributeError: module 'urllib' has no attribute 'error'
In [5]:
import urllib.error
In [6]:
print(urllib.error)
In [7]:
print(urllib.error.HTTPError)
In [8]:
from urllib import error
In [9]:
print(error)
In [10]:
print(error.HTTPError)
In [11]:
from urllib.error import HTTPError
In [12]:
print(HTTPError)