我正在尝试使用此代码从服务器获取服务器状态的响应
import requests
import urllib3
try:
r = requests.get('https://gookle.com')
print r.status_code
print r.raise_for_status()
except requests.exceptions.Timeout as timeoutext:
print timeoutext
except requests.exceptions.TooManyRedirects as tooMany:
print tooMany
except requests.exceptions.ConnectionError as e:
print ("OOps: Something Else", e)
except requests.ConnectionError as cr:
print cr
问题就在这里,当我输入正确的网址如https://www.google.com
时,这是好的,但当我把**https://www.gookle.com**
错误的网址时间输出时:
('OOps: Something Else', SSLError(MaxRetryError("HTTPSConnectionPool(host='fafcebook.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:661)'),))",),))