Assuming you did
import requests, you want
requests.ConnectionError.
ConnectionErroris an exception defined by
requests. See the API
documentation here.
Thus the pre should be :
try: requests.get('http://www.google.com')except requests.ConnectionError: # handle the exception


