Micro-sheep / Micro-sheep/efinance
最近好像被东方财富针对了,下数据时频繁报类似的错
- Dominant language
- Python
- Stars
- 4.1k
- Forks
- 755
- PR merge metrics
- No merged PRs in 30d
Description
alldate = ef.stock.get_quote_history('399001', beg=beg.replace('-',''), end=end.replace('-',''), fqt=2).iloc[:,2]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\Lib\site-packages\efinance\stock\getter.py", line 299, in get_quote_history
df = get_quote_history_for_stock(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\Lib\site-packages\efinance\common\getter.py", line 288, in get_quote_history
return get_quote_history_single(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\Lib\site-packages\efinance\utils\__init__.py", line 48, in run
values = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\Lib\site-packages\efinance\common\getter.py", line 152, in get_quote_history_single
json_response = session.get(
^^^^^^^^^^^^
File "D:\miniconda3\Lib\site-packages\requests\sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\Lib\site-packages\efinance\shared\__init__.py", line 14, in request
return super(CustomedSession, self).request(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\Lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\Lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\Lib\site-packages\requests\adapters.py", line 700, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='push2his.eastmoney.com', port=443): Max retries exceeded with url: /api/qt/stock/kline/get?fields1=f1%2Cf2%2Cf3%2Cf4%2Cf5%2Cf6%2Cf7%2Cf8%2Cf9%2Cf10%2Cf11%2Cf12%2Cf13&fields2=f51%2Cf52%2Cf53%2Cf54%2Cf55%2Cf56%2Cf57%2Cf58%2Cf59%2Cf60%2Cf61&beg=20230608&end=20250607&rtntype=6&secid=0.399001&klt=101&fqt=2 (Caused by ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))
Contributor guide
No contributing guide indexed for this repository
Research direction
The traceback points to efinance/common/getter.py, especially get_quote_history_single, and the custom request path in efinance/shared/__init__.py; start by reproducing get_quote_history('399001', ...) against the shown push2his.eastmoney.com URL. Compare the remote disconnect with existing request and error handling, then define the expected behavior for this failure; done means the behavior is verified for this call and covered by an appropriate regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100