tkfy920 / qstock

qstock由“Python金融量化”公众号开发,试图打造成个人量化投研分析包,目前包括数据获取(data)、可视化(plot)、选股(stock)和量化回测(策略backtest)模块。 qstock将为用户提供简洁的数据接口和规整化后的金融市场数据。可视化模块为用户提供基于web的交互图形的简单接口; 选股模块提供了同花顺的选股数据和自定义选股,包括RPS、MM趋势、财务指标、资金流模型等; 回测模块为大家提供向量化(基于pandas)和基于事件驱动的基本框架和模型。 关注“Python金融量化“微信公众号,获取更多应用信息。
MIT License
949 stars 246 forks source link

请求具体股票或者其他标的数据报错: HTTPSConnectionPool(host='searchapi.eastmoney.com', port=443): Max retries exceeded #31

Closed Crown-Messi closed 8 months ago

Crown-Messi commented 8 months ago

Traceback (most recent call last): File ".\processData.py", line 19, in df=qs.realtime_data(code="603266.SH") File "D:\programs\miniconda3\envs\QuantTrade\lib\site-packages\qstock\data\trade.py", line 232, in realtime_data return stock_realtime(code) File "D:\programs\miniconda3\envs\QuantTrade\lib\site-packages\qstock\data\trade.py", line 180, in stock_realtime secids = [get_code_id(code) File "D:\programs\miniconda3\envs\QuantTrade\lib\site-packages\qstock\data\trade.py", line 180, in secids = [get_code_id(code) File "D:\programs\miniconda3\envs\QuantTrade\lib\site-packages\qstock\data\util.py", line 493, in get_code_id response = session.get(url, params=params).json() File "D:\programs\miniconda3\envs\QuantTrade\lib\site-packages\requests\sessions.py", line 602, in get return self.request("GET", url, kwargs) File "D:\programs\miniconda3\envs\QuantTrade\lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "D:\programs\miniconda3\envs\QuantTrade\lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "D:\programs\miniconda3\envs\QuantTrade\lib\site-packages\requests\adapters.py", line 513, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='searchapi.eastmoney.com', port=443): Max retries exceeded with url: /api/suggest/get?input=603266.SH&type=14&token=D43BF722C8E33BDC906FB84D85E326E8 (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1131)'))))

Crown-Messi commented 8 months ago

已解决,需要降低urllib版本 pip install urllib3==1.25.11