feat: restore zhihu browser skills
Reconnect the recovered Zhihu skill flows to the live browser runtime and resolve their resources relative to the executable so they work outside the repo root. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
19
resources/skills/zhihu_hotlist_flow.json
Normal file
19
resources/skills/zhihu_hotlist_flow.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"hotlist_url": "https://www.zhihu.com/hot",
|
||||
"domains": {
|
||||
"zhihu": "www.zhihu.com"
|
||||
},
|
||||
"literals": {
|
||||
"hotlist_guard": "热榜"
|
||||
},
|
||||
"selectors": {
|
||||
"hotlist_root": "main, body",
|
||||
"hotlist_item": ".HotList-item, [data-hot-item], section ol li",
|
||||
"hotlist_title_link": ".HotList-item-title a, h2 a, .ContentItem-title a",
|
||||
"hotlist_summary": ".HotList-item-summary, .HotItem-content, .RichContent-inner, .ContentItem-excerpt",
|
||||
"hotlist_heat": ".HotList-item-heat, .HotItem-metrics, .HotItem-hot",
|
||||
"comment_list": ".Comments-list, .CommentListV2, [data-testid='comment-list'], .CommentList",
|
||||
"comment_item": ".Comments-list > .CommentItem, .CommentListV2 > .CommentItem, .CommentItemV2, .CommentItem",
|
||||
"comment_metric": ".CommentItem-metric, .CommentItem-footer button, .ContentItem-actions button, button"
|
||||
}
|
||||
}
|
||||
2481
resources/skills/zhihu_navigation_pages.json
Normal file
2481
resources/skills/zhihu_navigation_pages.json
Normal file
File diff suppressed because it is too large
Load Diff
126
resources/skills/zhihu_write_flow.json
Normal file
126
resources/skills/zhihu_write_flow.json
Normal file
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"entry_url": "https://www.zhihu.com/creator",
|
||||
"editor_url": "https://zhuanlan.zhihu.com/write",
|
||||
"domains": {
|
||||
"creator": "www.zhihu.com",
|
||||
"editor": "zhuanlan.zhihu.com"
|
||||
},
|
||||
"literals": {
|
||||
"write_entry_text": "写文章",
|
||||
"title_placeholder": "请输入标题(最多 100 个字)",
|
||||
"body_role": "textbox",
|
||||
"publish_text": "发布",
|
||||
"publish_confirm_text": "确认发布"
|
||||
},
|
||||
"selectors": {
|
||||
"creator_write_panel": "div.css-1q62b6s",
|
||||
"creator_write_entry": "div.css-1q62b6s > div.css-byu4by",
|
||||
"title_input": "textarea[placeholder='请输入标题(最多 100 个字)']",
|
||||
"body_editor": "div.notranslate.public-DraftEditor-content[contenteditable='true'][role='textbox']",
|
||||
"publish_button": "button.Button--primary.Button--blue",
|
||||
"publish_confirm_dialog": "div[role='dialog']",
|
||||
"publish_confirm_button": "div[role='dialog'] button.Button--primary.Button--blue",
|
||||
"published_title": "h1"
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "navigate_creator",
|
||||
"action": "navigate",
|
||||
"expected_domain": "creator",
|
||||
"url_ref": "entry_url",
|
||||
"log_message": "navigate https://www.zhihu.com/creator"
|
||||
},
|
||||
{
|
||||
"name": "click_write_article",
|
||||
"action": "click",
|
||||
"expected_domain": "creator",
|
||||
"selector_ref": "creator_write_entry",
|
||||
"wait_after_ms": 1500,
|
||||
"log_message": "click 写文章"
|
||||
},
|
||||
{
|
||||
"name": "wait_editor_ready",
|
||||
"action": "waitForSelector",
|
||||
"expected_domain": "editor",
|
||||
"selector_ref": "title_input",
|
||||
"timeout_ms": 8000,
|
||||
"log_message": "wait for editor title input"
|
||||
},
|
||||
{
|
||||
"name": "type_title",
|
||||
"action": "type",
|
||||
"expected_domain": "editor",
|
||||
"selector_ref": "title_input",
|
||||
"text_source": "title",
|
||||
"clear_first": true,
|
||||
"log_message": "type article title into 请输入标题(最多 100 个字)"
|
||||
},
|
||||
{
|
||||
"name": "type_body",
|
||||
"action": "type",
|
||||
"expected_domain": "editor",
|
||||
"selector_ref": "body_editor",
|
||||
"text_source": "body",
|
||||
"clear_first": true,
|
||||
"log_message": "type article body into editor textbox"
|
||||
},
|
||||
{
|
||||
"name": "scroll_publish_button",
|
||||
"action": "scrollTo",
|
||||
"expected_domain": "editor",
|
||||
"selector_ref": "publish_button",
|
||||
"only_when_publish": true,
|
||||
"log_message": "scroll to 发布"
|
||||
},
|
||||
{
|
||||
"name": "click_publish",
|
||||
"action": "click",
|
||||
"expected_domain": "editor",
|
||||
"selector_ref": "publish_button",
|
||||
"wait_after_ms": 800,
|
||||
"only_when_publish": true,
|
||||
"capture_url": true,
|
||||
"log_message": "click 发布"
|
||||
},
|
||||
{
|
||||
"name": "wait_publish_confirm_dialog",
|
||||
"action": "waitForSelector",
|
||||
"expected_domain": "editor",
|
||||
"selector_ref": "publish_confirm_dialog",
|
||||
"timeout_ms": 8000,
|
||||
"only_when_publish": true,
|
||||
"log_message": "wait for publish confirm dialog"
|
||||
},
|
||||
{
|
||||
"name": "click_publish_confirm",
|
||||
"action": "click",
|
||||
"expected_domain": "editor",
|
||||
"selector_ref": "publish_confirm_button",
|
||||
"wait_after_ms": 1500,
|
||||
"only_when_publish": true,
|
||||
"capture_url": true,
|
||||
"log_message": "click 确认发布"
|
||||
},
|
||||
{
|
||||
"name": "wait_published_title",
|
||||
"action": "waitForSelector",
|
||||
"expected_domain": "editor",
|
||||
"selector_ref": "published_title",
|
||||
"timeout_ms": 15000,
|
||||
"only_when_publish": true,
|
||||
"capture_url": true,
|
||||
"log_message": "wait for published article title"
|
||||
},
|
||||
{
|
||||
"name": "confirm_published_title",
|
||||
"action": "getText",
|
||||
"expected_domain": "editor",
|
||||
"selector_ref": "published_title",
|
||||
"only_when_publish": true,
|
||||
"expect_text_source": "title",
|
||||
"allow_empty_text": true,
|
||||
"capture_url": true,
|
||||
"log_message": "verify published article title"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user