Closed lt0000007 closed 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'
详细问题描述
- 64 windows
- Python 版本,3.11
- AKShare 版本,akshare-1.14.86
- futures_comm_info_df = ak.futures_comm_info(symbol="所有")
- 接口报错的截图或描述 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
详细问题描述