使用方法:
- 下载automa插件,
- 代码另存为百度搜索.automa.json,然后在插件中进行导入。
代码如下:
{
"extVersion": "1.28.27",
"name": "百度搜索",
"icon": "riGlobalLine",
"table": [
{
"id": "SnoqB",
"name": "title",
"type": "string"
}
],
"version": "1.28.27",
"drawflow": {
"nodes": [
{
"type": "BlockBasic",
"data": {
"activeInInput": false,
"contextMenuName": "",
"contextTypes": [],
"date": "",
"days": [],
"delay": 5,
"description": "",
"disableBlock": false,
"interval": 60,
"isUrlRegex": false,
"observeElement": {
"baseElOptions": {
"attributeFilter": [],
"attributes": false,
"characterData": false,
"childList": true,
"subtree": false
},
"baseSelector": "",
"matchPattern": "",
"selector": "",
"targetOptions": {
"attributeFilter": [],
"attributes": false,
"characterData": false,
"childList": true,
"subtree": false
}
},
"parameters": [],
"preferParamsInTab": false,
"shortcut": "",
"time": "00:00",
"type": "manual",
"url": ""
},
"events": {},
"id": "u-zO1EKe2Bra2oGjcsqi0",
"label": "trigger",
"position": {
"x": 96,
"y": 58.5
}
},
{
"type": "BlockBasic",
"data": {
"active": true,
"customUserAgent": false,
"description": "打开百度",
"disableBlock": false,
"inGroup": false,
"tabZoom": 1,
"updatePrevTab": false,
"url": "http://www.baidu.com",
"userAgent": "",
"waitTabLoaded": true
},
"events": {},
"id": "1rwfg01",
"label": "new-tab",
"position": {
"x": 388,
"y": 58.5
}
},
{
"type": "BlockBasic",
"data": {
"assignVariable": false,
"clearValue": true,
"dataColumn": "",
"delay": "200",
"description": "输入搜索关键字",
"disableBlock": false,
"events": [],
"findBy": "cssSelector",
"getValue": false,
"markEl": false,
"multiple": false,
"optionPosition": "1",
"saveData": false,
"selectOptionBy": "value",
"selected": true,
"selector": "input#kw",
"type": "text-field",
"value": "今日60s",
"variableName": "",
"waitForSelector": false,
"waitSelectorTimeout": 5000
},
"events": {},
"id": "ys157ng",
"label": "forms",
"position": {
"x": 680,
"y": 58.5
}
},
{
"type": "BlockBasic",
"data": {
"description": "开始搜索",
"disableBlock": false,
"findBy": "cssSelector",
"markEl": false,
"multiple": false,
"selector": "input#su",
"waitForSelector": false,
"waitSelectorTimeout": 5000
},
"events": {},
"id": "kb0mea5",
"label": "event-click",
"position": {
"x": 972,
"y": 58.5
}
},
{
"type": "BlockDelay",
"data": {
"disableBlock": false,
"time": "600"
},
"events": {},
"id": "qdkx06k",
"label": "delay",
"position": {
"x": 1264,
"y": 58.5
}
},
{
"type": "BlockBasic",
"data": {
"addExtraRow": false,
"assignVariable": false,
"dataColumn": "SnoqB",
"description": "获取搜索结果",
"disableBlock": false,
"extraRowDataColumn": "",
"extraRowValue": "",
"findBy": "xpath",
"includeTags": false,
"markEl": false,
"multiple": true,
"prefixText": "",
"regex": "",
"regexExp": [],
"saveData": true,
"selector": "//div[@id=\"content_left\"]//div[@class=\"c-container\"]/div[1]/h3",
"suffixText": "",
"useTextContent": false,
"variableName": "title",
"waitForSelector": false,
"waitSelectorTimeout": 5000
},
"events": {},
"id": "gfbqkom",
"label": "get-text",
"position": {
"x": 1556,
"y": 58.5
}
},
{
"type": "BlockBasic",
"data": {
"disableBlock": false,
"url": "",
"description": "关闭标签页",
"activeTab": true,
"closeType": "tab",
"allWindows": false
},
"events": {},
"position": {
"x": 2140,
"y": 58.5
},
"label": "close-tab",
"id": "6zi7tl2"
},
{
"type": "BlockDelay",
"data": {
"disableBlock": false,
"time": 500
},
"events": {},
"position": {
"x": 1848,
"y": 58.5
},
"label": "delay",
"id": "6b6a0a2"
}
],
"edges": [
{
"type": "custom",
"updatable": true,
"selectable": true,
"markerEnd": "arrowclosed",
"sourceHandle": "u-zO1EKe2Bra2oGjcsqi0-output-1",
"targetHandle": "1rwfg01-input-1",
"source": "u-zO1EKe2Bra2oGjcsqi0",
"target": "1rwfg01",
"data": {},
"events": {},
"id": "vueflow__edge-u-zO1EKe2Bra2oGjcsqi0u-zO1EKe2Bra2oGjcsqi0-output-1-1rwfg011rwfg01-input-1",
"sourceX": 308,
"sourceY": 94.5,
"targetX": 368,
"targetY": 94.5
},
{
"type": "custom",
"updatable": true,
"selectable": true,
"markerEnd": "arrowclosed",
"sourceHandle": "1rwfg01-output-1",
"targetHandle": "ys157ng-input-1",
"source": "1rwfg01",
"target": "ys157ng",
"data": {},
"events": {},
"id": "vueflow__edge-1rwfg011rwfg01-output-1-ys157ngys157ng-input-1",
"sourceX": 600,
"sourceY": 94.5,
"targetX": 660,
"targetY": 94.5
},
{
"type": "custom",
"updatable": true,
"selectable": true,
"markerEnd": "arrowclosed",
"sourceHandle": "ys157ng-output-1",
"targetHandle": "kb0mea5-input-1",
"source": "ys157ng",
"target": "kb0mea5",
"data": {},
"events": {},
"id": "vueflow__edge-ys157ngys157ng-output-1-kb0mea5kb0mea5-input-1",
"sourceX": 892,
"sourceY": 94.5,
"targetX": 952,
"targetY": 94.5
},
{
"type": "custom",
"updatable": true,
"selectable": true,
"markerEnd": "arrowclosed",
"sourceHandle": "kb0mea5-output-1",
"targetHandle": "qdkx06k-input-1",
"source": "kb0mea5",
"target": "qdkx06k",
"data": {},
"events": {},
"id": "vueflow__edge-kb0mea5kb0mea5-output-1-qdkx06kqdkx06k-input-1",
"sourceX": 1184,
"sourceY": 94.5,
"targetX": 1244,
"targetY": 117.1875
},
{
"type": "custom",
"updatable": true,
"selectable": true,
"markerEnd": "arrowclosed",
"sourceHandle": "qdkx06k-output-1",
"targetHandle": "gfbqkom-input-1",
"source": "qdkx06k",
"target": "gfbqkom",
"data": {},
"events": {},
"class": "connected-edges",
"id": "vueflow__edge-qdkx06kqdkx06k-output-1-gfbqkomgfbqkom-input-1",
"sourceX": 1476,
"sourceY": 117.1875,
"targetX": 1536,
"targetY": 94.5
},
{
"sourceHandle": "gfbqkom-output-1",
"targetHandle": "6b6a0a2-input-1",
"type": "custom",
"source": "gfbqkom",
"target": "6b6a0a2",
"updatable": true,
"selectable": true,
"data": {},
"events": {},
"markerEnd": "arrowclosed",
"id": "vueflow__edge-gfbqkomgfbqkom-output-1-6zi7tl26zi7tl2-input-1",
"sourceX": 1768,
"sourceY": 94.5,
"targetX": 1828,
"targetY": 117.1875
},
{
"sourceHandle": "6b6a0a2-output-1",
"targetHandle": "6zi7tl2-input-1",
"type": "custom",
"source": "6b6a0a2",
"target": "6zi7tl2",
"updatable": true,
"selectable": true,
"data": {},
"events": {},
"markerEnd": "arrowclosed",
"id": "vueflow__edge-6b6a0a26b6a0a2-output-1-6zi7tl26zi7tl2-input-1",
"sourceX": 2060,
"sourceY": 117.1875,
"targetX": 2120,
"targetY": 94.5
}
],
"position": [
3.958156431916791,
307.7615004158095
],
"zoom": 0.5042237492887468,
"viewport": {
"x": 3.958156431916791,
"y": 307.7615004158095,
"zoom": 0.5042237492887468
}
},
"settings": {
"blockDelay": 0,
"debugMode": false,
"defaultColumnName": "column",
"execContext": "popup",
"executedBlockOnWeb": false,
"inputAutocomplete": true,
"insertDefaultColumn": false,
"notification": true,
"onError": "stop-workflow",
"publicId": "",
"restartTimes": 3,
"reuseLastState": false,
"saveLog": true,
"tabLoadTimeout": 30000
},
"globalData": "{\n\t\"key\": \"value\"\n}",
"description": "",
"includedWorkflows": {}
}