Skip to content

webview_novel 网站格式发生了改变导致正则表达式匹配不上 #411

Description

@DiLiuNEUexpresscompany

{
"params": {
"novel_id": 133151265
},
"response": {
"content": [
{
"type": "text",
"text": "{\n "error": "获取小说正文失败: Extract novel content error: 'NoneType' object has no attribute 'groups'",\n "tool": "pixiv_novel_text",\n "arguments": {\n "novel_id": 133151265\n }\n}"
}
]
}
}

问题描述:
re.search(r"novel:\s({.+}),\s+isOwnWork", r.text) 返回了 None
当正则表达式没有找到匹配时,re.search 返回 None
然后代码尝试调用 None.groups()[0],导致 'NoneType' object has no attribute 'groups' 错误

可能原因:
Pixiv 可能更新了网页结构,JavaScript 中的数据格式发生了变化

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions