myagent-ai 1.15.90 → 1.15.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.15.90",
3
+ "version": "1.15.91",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {
@@ -330,8 +330,15 @@ class WebReadSkill(Skill):
330
330
  for tag in soup(["script", "style", "nav", "footer", "header", "aside"]):
331
331
  tag.decompose()
332
332
  # 移除所有 class 含特定关键词的元素
333
+ # 注意: decompose() 会连带销毁子元素,子元素的 attrs 变为 None,
334
+ # 因此必须检查 tag.parent 是否为 None 来跳过已被销毁的标签
333
335
  for tag in soup.find_all(True, class_=True):
334
- cls_str = " ".join(tag.get("class", []))
336
+ if tag.parent is None:
337
+ continue
338
+ try:
339
+ cls_str = " ".join(tag.get("class", []))
340
+ except (AttributeError, TypeError):
341
+ continue
335
342
  if any(kw in cls_str.lower() for kw in
336
343
  ["sidebar", "footer", "nav", "header", "advertisement",
337
344
  "cookie", "popup", "modal", "banner", "social", "share"]):