prop(style) 会为文本、注释和文档节点抛出异常
作者: xu91102创建于 2026年9月26日更新于 2026年9月26日
在文本、注释或文档节点上读取 `.prop('style')` 会抛出 `TypeError: Cannot convert undefined or null to object`。其他仅限于元素的属性获取器在这些节点上返回 undefined,而 `.css()` 也已经返回 undefined。
内容来源: cheeriojs/cheerio
在文本、注释或文档节点上读取 `.prop('style')` 会抛出 `TypeError: Cannot convert undefined or null to object`。其他仅限于元素的属性获取器在这些节点上返回 undefined,而 `.css()` 也已经返回 undefined。
内容来源: cheeriojs/cheerio