SSLError(MaxRetryError(" HTTPSConnectionPool(host =' fafcebook.com',port = 443)

时间:2017-11-10 05:41:37

标签: python-2.7 python-requests

我正在尝试使用此代码从服务器获取服务器状态的响应

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)'),))",),))

0 个答案:

没有答案