I’m looking for a quick way to get an HTTP response code from a URL (i.e. 200, 404, etc). I’m not sure which library to use.
The urllib2.HTTPError exception does not contain a getcode() method. Use the code attribute instead.
urllib2.HTTPError
getcode()
code