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.46k stars 1.9k forks source link

Desc: 个股新闻数据 #4305

Closed ZhuJD-China closed 11 months ago

ZhuJD-China commented 11 months ago

E:\Anaconda\python.exe E:\Anaconda\Lib\site-packages\akshare\news\news_stock.py Traceback (most recent call last): File "E:\Anaconda\Lib\site-packages\akshare\news\news_stock.py", line 86, in stock_news_em_df = stock_news_em(symbol="300059") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Anaconda\Lib\site-packages\akshare\news\news_stock.py", line 36, in stock_news_em temp_df = pd.DataFrame(data_json["result"]["cmsArticleWebOld"])


KeyError: 'cmsArticleWebOld'

Process finished with exit code 1
albertandking commented 11 months ago

E:\Anaconda\python.exe E:\Anaconda\Lib\site-packages\akshare\news\news_stock.py Traceback (most recent call last): File "E:\Anaconda\Lib\site-packages\akshare\news\news_stock.py", line 86, in stock_news_em_df = stock_news_em(symbol="300059") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Anaconda\Lib\site-packages\akshare\news\news_stock.py", line 36, in stock_news_em temp_df = pd.DataFrame(data_json["result"]["cmsArticleWebOld"]) ~~~~~~~^^^^^^^^^^^^^^^^^^^^ KeyError: 'cmsArticleWebOld'

Process finished with exit code 1

接口正常,注意调用频率

ZhuJD-China commented 11 months ago

每次返回的都是这个:{'bizCode': '', 'bizMsg': '', 'code': 0, 'extra': {}, 'hitsTotal': 1, 'msg': 'OK', 'result': {'passportWeb': [{'uid': '8223456637392854', 'stockFollowerCount': 7289, 'alias': '达利食品', 'postCount': 0, 'fansCount': 0, 'portrait': 'https://avator.eastmoney.com/qface/8223456637392854/180', 'url': 'http://iguba.eastmoney.com/8223456637392854', 'introduction': ' ', 'userFollowingCount': 0, 'userSelectStockCount': 0}]}, 'searchId': 'b93a1e15-8497-4b4c-a4c8-744305b6f2d8'}

albertandking commented 11 months ago

每次返回的都是这个:{'bizCode': '', 'bizMsg': '', 'code': 0, 'extra': {}, 'hitsTotal': 1, 'msg': 'OK', 'result': {'passportWeb': [{'uid': '8223456637392854', 'stockFollowerCount': 7289, 'alias': '达利食品', 'postCount': 0, 'fansCount': 0, 'portrait': 'https://avator.eastmoney.com/qface/8223456637392854/180', 'url': 'http://iguba.eastmoney.com/8223456637392854', 'introduction': ' ', 'userFollowingCount': 0, 'userSelectStockCount': 0}]}, 'searchId': 'b93a1e15-8497-4b4c-a4c8-744305b6f2d8'}

切换个 IP,再下看

ZhuJD-China commented 11 months ago

还是一样,有什么IP限制吗

albertandking commented 11 months ago

还是一样,有什么IP限制吗

没有,我这边是正常的

ZhuJD-China commented 11 months ago

找安全的看过了,接口返回的值和之前取的值有变化,是不是代码和接口参数有没更新上传的

ZhuJD-China commented 11 months ago

是否做了校验? 正常用request库请求不出来