我对SSL请求模块错误有疑问吗?

时间:2019-04-01 10:41:37

标签: python ssl request

不太确定为什么会出现此错误,我尝试搜索解决方案,但是都失败了。如果有人可以帮助我,那就太好了。

  

错误; HTTPSConnectionPool(host ='min-api.cryptocompare.com',   port = 443):网址超过了最大重试次数:   / data / pricemultifull?fsyms = BTC&tsyms = USD(由SSLError(“无法   由于SSL模块不可用,请连接到HTTPS URL。“))

import requests 

apiurl = 'https://min-api.cryptocompare.com/data/pricemultifull?fsyms=BTC&tsyms=USD'

r = requests.get(apiurl)
print(r.json)

1 个答案:

答案 0 :(得分:0)

我尝试过:

import requests  
apiurl = 'https://min-api.cryptocompare.com/data/pricemultifull?fsyms=BTC&tsyms=USD' 

r = requests.get(apiurl) 
print(r.json()) 

我得到以下输出

{'RAW': {'BTC': {'USD': {'TYPE': '5', 'MARKET': 'CCCAGG', 'FROMSYMBOL': 'BTC', 'TOSYMBOL': 'USD', 'FLAGS': '2', 'PRICE': 4130.95, 'LASTUPDATE': 1554115944, 'LASTVOLUME': 0.28487923, 'LASTVOLUMETO': 1170.2610865016, 'LASTTRADEID': '15541159439900460000', 'VOLUMEDAY': 18479.44300860692, 'VOLUMEDAYTO': 76325046.14648715, 'VOLUME24HOUR': 26270.17398139309, 'VOLUME24HOURTO': 108384093.59153283, 'OPENDAY': 4112.79, 'HIGHDAY': 4147.4, 'LOWDAY': 4082.2, 'OPEN24HOUR': 4108.58, 'HIGH24HOUR': 4155.27, 'LOW24HOUR': 4071.17, 'LASTMARKET': 'Bitlish', 'VOLUMEHOUR': 896.750348464797, 'VOLUMEHOURTO': 3701972.402759318, 'OPENHOUR': 4138.59, 'HIGHHOUR': 4141.98, 'LOWHOUR': 4130.29, 'CHANGE24HOUR': 22.36999999999989, 'CHANGEPCT24HOUR': 0.5444703522871622, 'CHANGEDAY': 18.159999999999854, 'CHANGEPCTDAY': 0.4415494104974933, 'SUPPLY': 17620525, 'MKTCAP': 72789507748.75, 'TOTALVOLUME24H': 319890.30644538533, 'TOTALVOLUME24HTO': 1321314179.7936616, 'IMAGEURL': '/media/19633/btc.png'}}}, 'DISPLAY': {'BTC': {'USD': {'FROMSYMBOL': 'Ƀ', 'TOSYMBOL': '$', 'MARKET': 'CryptoCompare Index', 'PRICE': '$ 4,130.95', 'LASTUPDATE': 'Just now', 'LASTVOLUME': 'Ƀ 0.2849', 'LASTVOLUMETO': '$ 1,170.26', 'LASTTRADEID': '15541159439900460000', 'VOLUMEDAY': 'Ƀ 18,479.4', 'VOLUMEDAYTO': '$ 76,325,046.1', 'VOLUME24HOUR': 'Ƀ 26,270.2', 'VOLUME24HOURTO': '$ 108,384,093.6', 'OPENDAY': '$ 4,112.79', 'HIGHDAY': '$ 4,147.40', 'LOWDAY': '$ 4,082.20', 'OPEN24HOUR': '$ 4,108.58', 'HIGH24HOUR': '$ 4,155.27', 'LOW24HOUR': '$ 4,071.17', 'LASTMARKET': 'Bitlish', 'VOLUMEHOUR': 'Ƀ 896.75', 'VOLUMEHOURTO': '$ 3,701,972.4', 'OPENHOUR': '$ 4,138.59', 'HIGHHOUR': '$ 4,141.98', 'LOWHOUR': '$ 4,130.29', 'CHANGE24HOUR': '$ 22.37', 'CHANGEPCT24HOUR': '0.54', 'CHANGEDAY': '$ 18.16', 'CHANGEPCTDAY': '0.44', 'SUPPLY': 'Ƀ 17,620,525.0', 'MKTCAP': '$ 72.79 B', 'TOTALVOLUME24H': 'Ƀ 319.89 K', 'TOTALVOLUME24HTO': '$ 1,321.31 M', 'IMAGEURL': '/media/19633/btc.png'}}}}