urllib2 is better than urllib as it will indicate if there was an error retreiving

examples/other/try_urllib2.py
#!/usr/bin/env python
from __future__ import print_function

import urllib2

# f is like a filehand for http requests
f = urllib2.urlopen('http://python.org/')
html = f.read()   # is like a get() request
f.close()
print(html)


try:
    f = urllib2.urlopen('http://python.org/some_missing_page')
    html = f.read()
    f.close()
    print(html)
except urllib2.HTTPError as e:
    print(e)   # HTTP Error 404: OK