oc-browser-relay 1.0.1 → 1.0.2

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.
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "files": [
3
+ "sycm-taobao-home.json",
3
4
  "xiaohongshu-creator-publish.json",
4
5
  "xiaohongshu-web-explore.json",
5
6
  "xiaohongshu-web-search-result.json",
@@ -0,0 +1,124 @@
1
+ {
2
+ "pageId": "sycm_taobao_home",
3
+ "pageName": "生意参谋首页",
4
+ "platform": "taobao",
5
+ "siteId": "sycm_taobao",
6
+ "pageType": "dashboard_home",
7
+ "capabilities": {
8
+ "siteMetrics": true,
9
+ "realtimeMetrics": true
10
+ },
11
+ "version": "1.0.0",
12
+ "urlMatch": [
13
+ "https://sycm.taobao.com/portal/home.htm*"
14
+ ],
15
+ "readiness": {
16
+ "loginRequired": true,
17
+ "pageReadyWhen": {
18
+ "type": "logical_or",
19
+ "conditions": [
20
+ {
21
+ "type": "element_visible",
22
+ "selector": "button.ant-btn-primary.ant-btn-sm"
23
+ },
24
+ {
25
+ "type": "element_visible",
26
+ "selector": ".oui-canary-btn.ant-btn-primary"
27
+ }
28
+ ]
29
+ },
30
+ "waitTimeoutMs": 15000
31
+ },
32
+ "reusePolicy": {
33
+ "enabled": true,
34
+ "taskTypes": ["browser_action"],
35
+ "includeSameHostPages": true,
36
+ "candidatePages": [
37
+ "sycm_taobao_home"
38
+ ],
39
+ "resetActions": [
40
+ {
41
+ "when": "target_page",
42
+ "kind": "scroll_to_top"
43
+ },
44
+ {
45
+ "when": "same_host_non_target",
46
+ "kind": "click_locator",
47
+ "locators": [
48
+ {
49
+ "kind": "css",
50
+ "value": "a.ebase-frame-header-logo",
51
+ "priority": 1
52
+ }
53
+ ],
54
+ "waitForUrlMatch": [
55
+ "https://sycm.taobao.com/portal/index.htm*",
56
+ "https://sycm.taobao.com/portal/home.htm*"
57
+ ],
58
+ "waitTimeoutMs": 15000,
59
+ "settleDelayMs": 600
60
+ }
61
+ ]
62
+ },
63
+ "executionPolicy": {
64
+ "clickPolicy": {
65
+ "scrollIntoView": true,
66
+ "requireVisible": true,
67
+ "preHover": true,
68
+ "hoverDurationMsRange": [100, 220],
69
+ "preClickPauseMsRange": [60, 160]
70
+ },
71
+ "humanBehavior": {
72
+ "cursorMoveSpeedRange": [78, 128],
73
+ "cursorStepDelayMsRange": [4, 10],
74
+ "cursorVisibleDurationMsRange": [180, 320],
75
+ "minCursorStepCount": 12,
76
+ "mouseDownUpDelayMsRange": [40, 120],
77
+ "postClickPauseMsRange": [60, 180]
78
+ },
79
+ "actionPausePolicy": {
80
+ "minPauseMs": 160,
81
+ "maxPauseMs": 900
82
+ }
83
+ },
84
+ "actions": {
85
+ "refresh_live_metrics": {
86
+ "actionId": "refresh_live_metrics",
87
+ "label": "刷新首页店铺数据",
88
+ "kind": "click",
89
+ "locators": [
90
+ {
91
+ "kind": "xpath",
92
+ "value": "//span[normalize-space(.)='数据概览']/ancestor::div[contains(@class,'pro-layout-card-header__content')][1]//div[contains(@class,'oui-date-picker-particle-button')]//button[.//span[translate(normalize-space(.), ' ', '')='实时']]",
93
+ "priority": 1
94
+ }
95
+ ]
96
+ }
97
+ },
98
+ "crawlerHints": {
99
+ "structuredDataExtractors": {
100
+ "live_metrics": {
101
+ "adapterId": "sycm_home_live_metrics",
102
+ "sourceId": "live_metrics",
103
+ "timeoutMs": 60000,
104
+ "observationSources": [
105
+ {
106
+ "sourceId": "live_metrics_capture",
107
+ "nodeIdArg": "sourceNodeId",
108
+ "sourceType": "active_capture_results",
109
+ "consumeCapture": true,
110
+ "resultPath": "$self"
111
+ }
112
+ ],
113
+ "outputSchema": {
114
+ "root": {
115
+ "overview": "sources.live_metrics.overview",
116
+ "trend": "sources.live_metrics.trend",
117
+ "capturedAt": "sources.live_metrics.capturedAt",
118
+ "meta": "sources.live_metrics.meta"
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+ }
@@ -39,10 +39,10 @@
39
39
  "preClickPauseMsRange": [60, 160]
40
40
  },
41
41
  "humanBehavior": {
42
- "cursorMoveSpeedRange": [42, 72],
43
- "cursorStepDelayMsRange": [8, 18],
44
- "cursorVisibleDurationMsRange": [280, 520],
45
- "minCursorStepCount": 18,
42
+ "cursorMoveSpeedRange": [78, 128],
43
+ "cursorStepDelayMsRange": [4, 10],
44
+ "cursorVisibleDurationMsRange": [180, 320],
45
+ "minCursorStepCount": 12,
46
46
  "mouseDownUpDelayMsRange": [40, 120],
47
47
  "postClickPauseMsRange": [60, 180]
48
48
  },
@@ -137,9 +137,10 @@
137
137
  "product_comments": {
138
138
  "adapterId": "taobao_product_comments",
139
139
  "sourceId": "product_comments",
140
+ "timeoutMs": 180000,
140
141
  "collectionBehavior": {
141
142
  "type": "scroll_panel",
142
- "sourceStepIdArg": "sourceStepId",
143
+ "sourceNodeIdArg": "sourceNodeId",
143
144
  "targetCountArg": "targetCommentCount",
144
145
  "pagination": {
145
146
  "itemsPath": "data.rateList",
@@ -152,18 +153,14 @@
152
153
  "[class*='Drawer'] [class*='detailClassName']",
153
154
  "[class*='Drawer'] [class*='beautify-scroll-bar']"
154
155
  ],
155
- "maxScrollRounds": 24,
156
- "noNewResultsRounds": 4,
157
- "settleDelayMs": 900,
158
- "captureWaitTimeoutMs": 4200,
159
- "capturePollIntervalMs": 300,
156
+ "idleResponseTimeoutMs": 60000,
160
157
  "minScrollDistancePx": 360,
161
158
  "maxScrollDistancePx": 760
162
159
  },
163
160
  "observationSources": [
164
161
  {
165
162
  "sourceId": "product_comments_pages",
166
- "stepIdArg": "sourceStepId",
163
+ "nodeIdArg": "sourceNodeId",
167
164
  "sourceType": "active_capture_results",
168
165
  "consumeCapture": true,
169
166
  "resultPath": "bodyJson"
@@ -251,10 +251,36 @@
251
251
  "locators": [
252
252
  {
253
253
  "kind": "text",
254
- "value": "保存",
254
+ "value": "暂存离开",
255
255
  "priority": 1
256
+ },
257
+ {
258
+ "kind": "css",
259
+ "value": "button.custom-button.white, button[class*='custom-button'][class*='white']",
260
+ "priority": 2
261
+ },
262
+ {
263
+ "kind": "text",
264
+ "value": "保存",
265
+ "priority": 3
256
266
  }
257
- ]
267
+ ],
268
+ "postSuccessDialog": {
269
+ "required": true,
270
+ "waitTimeoutMs": 5000,
271
+ "pollIntervalMs": 250,
272
+ "visibleWhen": {
273
+ "type": "element_visible",
274
+ "selector": ".d-drawer-header .d-drawer-close"
275
+ },
276
+ "closeLocators": [
277
+ {
278
+ "kind": "css",
279
+ "value": ".d-drawer-header .d-drawer-close",
280
+ "priority": 1
281
+ }
282
+ ]
283
+ }
258
284
  }
259
285
  },
260
286
  "executionPolicy": {
@@ -287,18 +313,18 @@
287
313
  },
288
314
  "humanBehavior": {
289
315
  "cursorMoveSpeedRange": [
290
- 42,
291
- 72
316
+ 78,
317
+ 128
292
318
  ],
293
319
  "cursorStepDelayMsRange": [
294
- 8,
295
- 18
320
+ 4,
321
+ 10
296
322
  ],
297
323
  "cursorVisibleDurationMsRange": [
298
- 280,
299
- 520
324
+ 180,
325
+ 320
300
326
  ],
301
- "minCursorStepCount": 20,
327
+ "minCursorStepCount": 12,
302
328
  "mouseDownUpDelayMsRange": [
303
329
  40,
304
330
  120
@@ -148,18 +148,18 @@
148
148
  },
149
149
  "humanBehavior": {
150
150
  "cursorMoveSpeedRange": [
151
- 42,
152
- 72
151
+ 78,
152
+ 128
153
153
  ],
154
154
  "cursorStepDelayMsRange": [
155
- 8,
156
- 18
155
+ 4,
156
+ 10
157
157
  ],
158
158
  "cursorVisibleDurationMsRange": [
159
- 280,
160
- 520
159
+ 180,
160
+ 320
161
161
  ],
162
- "minCursorStepCount": 18,
162
+ "minCursorStepCount": 12,
163
163
  "mouseDownUpDelayMsRange": [
164
164
  40,
165
165
  120
@@ -528,18 +528,18 @@
528
528
  },
529
529
  "humanBehavior": {
530
530
  "cursorMoveSpeedRange": [
531
- 42,
532
- 72
531
+ 78,
532
+ 128
533
533
  ],
534
534
  "cursorStepDelayMsRange": [
535
- 8,
536
- 18
535
+ 4,
536
+ 10
537
537
  ],
538
538
  "cursorVisibleDurationMsRange": [
539
- 280,
540
- 520
539
+ 180,
540
+ 320
541
541
  ],
542
- "minCursorStepCount": 18,
542
+ "minCursorStepCount": 12,
543
543
  "mouseDownUpDelayMsRange": [
544
544
  40,
545
545
  120
@@ -2,6 +2,7 @@
2
2
  "files": [
3
3
  "xiaohongshu-creator.json",
4
4
  "xiaohongshu-web.json",
5
- "taobao-web.json"
5
+ "taobao-web.json",
6
+ "sycm-taobao.json"
6
7
  ]
7
8
  }
@@ -0,0 +1,13 @@
1
+ {
2
+ "siteId": "sycm_taobao",
3
+ "siteName": "生意参谋首页",
4
+ "platform": "taobao",
5
+ "hosts": [
6
+ "sycm.taobao.com"
7
+ ],
8
+ "loginPagePatterns": [
9
+ "https://login.taobao.com/havanaone/login/login.htm*",
10
+ "https://sycm.taobao.com/custom/login.htm*",
11
+ "https://sycm.taobao.com/portal/error.htm*"
12
+ ]
13
+ }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "files": [
3
+ "sycm-taobao-home-live-metrics.json",
3
4
  "xiaohongshu-creator-publish.json",
4
5
  "xiaohongshu-creator-save-draft.json",
5
- "xiaohongshu_open_website.json",
6
6
  "xiaohongshu-web-search-notes.json",
7
7
  "taobao-item-detail-comments.json"
8
8
  ]
@@ -0,0 +1,99 @@
1
+ {
2
+ "siteId": "sycm_taobao",
3
+ "taskType": "browser_action",
4
+ "platform": "taobao",
5
+ "name": "采集生意参谋首页店铺数据",
6
+ "description": "打开生意参谋首页,点击“实时 / 日 / 周 / 月”之一,同时采集首页概览与趋势接口。",
7
+ "requiredFields": [],
8
+ "optionalFields": [
9
+ {
10
+ "name": "url",
11
+ "type": "string",
12
+ "description": "生意参谋首页地址,默认首页",
13
+ "default": "https://sycm.taobao.com/portal/home.htm"
14
+ },
15
+ {
16
+ "name": "metricPeriodLabel",
17
+ "type": "string",
18
+ "description": "首页时间粒度按钮文本,支持:实时、日、周、月",
19
+ "default": "实时"
20
+ }
21
+ ],
22
+ "nodes": [
23
+ {
24
+ "nodeId": "s1",
25
+ "name": "open_sycm_home",
26
+ "goal": "打开或复用生意参谋首页标签页",
27
+ "tool": "open_tab",
28
+ "args": {
29
+ "url": "{{data.url}}"
30
+ }
31
+ },
32
+ {
33
+ "nodeId": "s2",
34
+ "name": "validate_sycm_home",
35
+ "goal": "校验当前页面已进入生意参谋首页",
36
+ "tool": "validate_page",
37
+ "args": {}
38
+ },
39
+ {
40
+ "nodeId": "s2b",
41
+ "name": "prepare_realtime_metrics",
42
+ "goal": "当目标为实时时,先切换到其他粒度,确保回切实时会触发刷新",
43
+ "condition": "equals(payload.metricPeriodLabel, '实时')",
44
+ "tool": "trigger_action",
45
+ "args": {
46
+ "action": "refresh_live_metrics",
47
+ "locators": [
48
+ {
49
+ "kind": "xpath",
50
+ "value": "//span[normalize-space(.)='数据概览']/ancestor::div[contains(@class,'pro-layout-card-header__content')][1]//div[contains(@class,'oui-date-picker-particle-button')]//button[.//span[translate(normalize-space(.), ' ', '')='日']]",
51
+ "priority": 1
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ {
57
+ "nodeId": "s3",
58
+ "name": "refresh_live_metrics",
59
+ "goal": "点击指定时间粒度按钮并开启首页指标接口捕获",
60
+ "tool": "trigger_action",
61
+ "args": {
62
+ "action": "refresh_live_metrics",
63
+ "locators": [
64
+ {
65
+ "kind": "xpath",
66
+ "value": "//span[normalize-space(.)='数据概览']/ancestor::div[contains(@class,'pro-layout-card-header__content')][1]//div[contains(@class,'oui-date-picker-particle-button')]//button[.//span[translate(normalize-space(.), ' ', '')='{{data.metricPeriodLabel}}']]",
67
+ "priority": 1
68
+ }
69
+ ],
70
+ "captureNetwork": {
71
+ "urlPattern": "https://sycm.taobao.com/portal/",
72
+ "method": "GET",
73
+ "timeoutMs": 15000,
74
+ "capability": "hybrid",
75
+ "operation": "capture_response",
76
+ "persistent": true,
77
+ "startPhase": "before_action",
78
+ "actionScope": "node",
79
+ "artifactType": "hybrid",
80
+ "includeBody": true,
81
+ "locationSuffix": "sycm_live_metrics",
82
+ "hint": "capture sycm home realtime metrics"
83
+ }
84
+ }
85
+ },
86
+ {
87
+ "nodeId": "s4",
88
+ "name": "collect_live_metrics",
89
+ "goal": "整合首页实时概览与趋势接口为统一结构化结果",
90
+ "tool": "collect_structured_data",
91
+ "args": {
92
+ "extractor": "live_metrics",
93
+ "sourceNodeId": "s3"
94
+ },
95
+ "storeAs": "liveMetrics",
96
+ "outputs": ["liveMetrics"]
97
+ }
98
+ ]
99
+ }
@@ -11,10 +11,17 @@
11
11
  "description": "淘宝或天猫商品详情页链接"
12
12
  }
13
13
  ],
14
- "optionalFields": [],
15
- "workflow": [
14
+ "optionalFields": [
16
15
  {
17
- "stepId": "s1",
16
+ "name": "targetCommentCount",
17
+ "type": "number",
18
+ "description": "目标抓取评论数量,默认 20",
19
+ "default": 20
20
+ }
21
+ ],
22
+ "nodes": [
23
+ {
24
+ "nodeId": "s1",
18
25
  "name": "open_product_detail",
19
26
  "goal": "打开淘宝商品详情页",
20
27
  "tool": "open_tab",
@@ -23,23 +30,25 @@
23
30
  }
24
31
  },
25
32
  {
26
- "stepId": "s2",
33
+ "nodeId": "s2",
27
34
  "name": "validate_product_detail_page",
28
35
  "goal": "校验当前页面已进入淘宝商品详情页",
29
36
  "tool": "validate_page",
30
37
  "args": {}
31
38
  },
32
39
  {
33
- "stepId": "s3",
40
+ "nodeId": "s3",
34
41
  "name": "collect_product_detail",
35
42
  "goal": "提取商品详情结构化数据",
36
43
  "tool": "collect_structured_data",
37
44
  "args": {
38
45
  "extractor": "product_detail"
39
- }
46
+ },
47
+ "storeAs": "detailData",
48
+ "outputs": ["detailData"]
40
49
  },
41
50
  {
42
- "stepId": "s4",
51
+ "nodeId": "s4",
43
52
  "name": "open_product_comments",
44
53
  "goal": "打开评价并截取评论接口",
45
54
  "tool": "trigger_action",
@@ -62,15 +71,19 @@
62
71
  }
63
72
  },
64
73
  {
65
- "stepId": "s5",
74
+ "nodeId": "s5",
66
75
  "name": "collect_product_comments",
67
76
  "goal": "投影评论接口为结构化评论数据",
68
77
  "tool": "collect_structured_data",
69
78
  "args": {
70
79
  "extractor": "product_comments",
71
- "sourceStepId": "s4",
72
- "targetCommentCount": 50
73
- }
80
+ "sourceNodeId": "s4"
81
+ },
82
+ "fromContext": {
83
+ "targetCommentCount": "payload.targetCommentCount"
84
+ },
85
+ "storeAs": "commentsData",
86
+ "outputs": ["commentsData"]
74
87
  }
75
88
  ]
76
89
  }
@@ -31,15 +31,15 @@
31
31
  "description": "要添加的话题标签数组,例如 [\"通勤穿搭\", \"春季搭配\"]"
32
32
  }
33
33
  ],
34
- "workflow": [
34
+ "nodes": [
35
35
  {
36
- "stepId": "s1",
36
+ "nodeId": "ensure_publish_ready",
37
37
  "name": "ensure_publish_ready",
38
38
  "tool": "ensure_publish_ready",
39
39
  "args": {}
40
40
  },
41
41
  {
42
- "stepId": "s2",
42
+ "nodeId": "upload_assets",
43
43
  "name": "upload_images",
44
44
  "tool": "upload_assets",
45
45
  "args": {
@@ -48,7 +48,7 @@
48
48
  }
49
49
  },
50
50
  {
51
- "stepId": "s3",
51
+ "nodeId": "fill_title",
52
52
  "name": "fill_title",
53
53
  "tool": "fill_field",
54
54
  "args": {
@@ -57,7 +57,7 @@
57
57
  }
58
58
  },
59
59
  {
60
- "stepId": "s4",
60
+ "nodeId": "fill_content",
61
61
  "name": "fill_content",
62
62
  "tool": "fill_field",
63
63
  "args": {
@@ -66,7 +66,7 @@
66
66
  }
67
67
  },
68
68
  {
69
- "stepId": "s5",
69
+ "nodeId": "submit_publish",
70
70
  "name": "publish",
71
71
  "tool": "trigger_action",
72
72
  "args": {
@@ -31,15 +31,15 @@
31
31
  "description": "要添加的话题标签数组,例如 [\"通勤穿搭\", \"春季搭配\"]"
32
32
  }
33
33
  ],
34
- "workflow": [
34
+ "nodes": [
35
35
  {
36
- "stepId": "s1",
36
+ "nodeId": "ensure_publish_ready",
37
37
  "name": "ensure_publish_ready",
38
38
  "tool": "ensure_publish_ready",
39
39
  "args": {}
40
40
  },
41
41
  {
42
- "stepId": "s2",
42
+ "nodeId": "upload_assets",
43
43
  "name": "upload_images",
44
44
  "tool": "upload_assets",
45
45
  "args": {
@@ -48,7 +48,7 @@
48
48
  }
49
49
  },
50
50
  {
51
- "stepId": "s3",
51
+ "nodeId": "fill_title",
52
52
  "name": "fill_title",
53
53
  "tool": "fill_field",
54
54
  "args": {
@@ -57,7 +57,7 @@
57
57
  }
58
58
  },
59
59
  {
60
- "stepId": "s4",
60
+ "nodeId": "fill_content",
61
61
  "name": "fill_content",
62
62
  "tool": "fill_field",
63
63
  "args": {
@@ -66,7 +66,7 @@
66
66
  }
67
67
  },
68
68
  {
69
- "stepId": "s5",
69
+ "nodeId": "submit_save_draft",
70
70
  "name": "save_draft",
71
71
  "tool": "trigger_action",
72
72
  "args": {