akfamily / akshare

AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
https://akshare.akfamily.xyz
MIT License
9.43k stars 1.9k forks source link

AKShare 接口问题报告futures_comm_info 获取期货手续费报错了,可能网页有所更新 #5209

Closed lt0000007 closed 1 month ago

lt0000007 commented 1 month ago

详细问题描述

  1. 64 windows
  2. Python 版本,3.11
  3. AKShare 版本,akshare-1.14.86
  4. futures_comm_info_df = ak.futures_comm_info(symbol="所有")
  5. 接口报错的截图或描述 File "D:\project\python\futures_change\common.py", line 210, in get_all_main_contract futures_comm_info_df = ak.futures_comm_info(symbol="所有") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\akshare\futures\futures_comm_qihuo.py", line 168, in futures_comm_info temp_df = pd.read_html(StringIO(r.text))[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\pandas\io\html.py", line 1240, in read_html return _parse( ^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\pandas\io\html.py", line 983, in _parse tables = p.parse_tables() ^^^^^^^^^^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\pandas\io\html.py", line 249, in parse_tables tables = self._parse_tables(self._build_doc(), self.match, self.attrs) ^^^^^^^^^^^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\pandas\io\html.py", line 809, in _build_doc raise XMLSyntaxError("no text parsed from document", 0, 0, 0) File "", line 0 lxml.etree.XMLSyntaxError: no text parsed from document
lt0000007 commented 1 month ago

补充有时候会报错以下内容: File "D:\project\python\futures_change\common.py", line 210, in get_all_main_contract futures_comm_info_df = ak.futures_comm_info(symbol="所有") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\akshare\futures\futures_comm_qihuo.py", line 217, in futures_comm_info
objs=[big_df, _futures_comm_qihuo_process(shfe_df, name="上海期货交易所")], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\akshare\futures\futures_comm_qihuo.py", line 144, in _futures_comm_qihuo_process raw_date_text = soup.find(name="a", attrs={"id": "dlink"}).previous ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'previous'

lt0000007 commented 1 month ago

详细问题描述

  1. 64 windows
  2. Python 版本,3.11
  3. AKShare 版本,akshare-1.14.86
  4. futures_comm_info_df = ak.futures_comm_info(symbol="所有")
  5. 接口报错的截图或描述 File "D:\project\python\futures_change\common.py", line 210, in get_all_main_contract futures_comm_info_df = ak.futures_comm_info(symbol="所有") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\akshare\futures\futures_comm_qihuo.py", line 168, in futures_comm_info temp_df = pd.read_html(StringIO(r.text))[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\pandas\io\html.py", line 1240, in read_html return _parse( ^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\pandas\io\html.py", line 983, in _parse tables = p.parse_tables() ^^^^^^^^^^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\pandas\io\html.py", line 249, in parse_tables tables = self._parse_tables(self._build_doc(), self.match, self.attrs) ^^^^^^^^^^^^^^^^^ File "E:\Program Files\anaconda3\Lib\site-packages\pandas\io\html.py", line 809, in _build_doc raise XMLSyntaxError("no text parsed from document", 0, 0, 0) File "", line 0 lxml.etree.XMLSyntaxError: no text parsed from document