fix: eastmoney_stock_news 兼容 cmsArticleWebOld 直接返回 list#8
Open
HughHouse wants to merge 1 commit into
Open
Conversation
东财搜索接口 cmsArticleWebOld 字段实测会直接返回文章 list,
而非 {"list": [...]},导致原代码 .get("list") 抛
'list' object has no attribute 'get'。改为类型自适应。
实测 603019/688017 回归通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
eastmoney_stock_news()在解析东财搜索接口时报错:定位到 SKILL.md 中:
实测(2026-05-20)东财接口
result.cmsArticleWebOld字段会直接返回文章 list,而不是{"list": [...]},因此多套的.get("list")在 list 上调用就抛异常。修复
改为对返回类型做自适应:
验证
对
603019(中科曙光)、688017(绿的谐波) 回归,均能正常返回新闻列表(title/content/time/source/url)。感谢这个非常实用的工具包 🙏