2

这是我的代码:

import urllib.request
try:
    url = 'https://bitinfocharts.com/comparison/hashrate-btc-dash-sma90.html'

# now, with the below headers, we defined ourselves as a simpleton who is
# still using internet explorer.
    headers = {}
    headers['User-Agent'] = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17"
    req = urllib.request.Request(url, headers = headers)
    resp = urllib.request.urlopen(req)
    respData = resp.read()

except Exception as e:
    print(str(e))
# Results come out as the follows,
<urlopen error [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)>

我使用 Python 3.5 并成功安装了pyOpenSSL。我自己想不通。

4

0 回答 0