-
使用循环内的文本(不勾选则每次输入的文本为下方“输入值”文本框内的文本,勾选后会使用所在循环内设置的文本)
+
使用循环内的文本(不勾选则每次输入的文本为下方“输入值”文本框内的文本,勾选后会使用所在“文本列表”循环内设置的文本)
@@ -415,20 +419,28 @@
元素在iframe内
+
-
-
切换模式
-
-
-
设定值(不适用于切换到下一个选项模式)
-
+
+
切换模式
+
+
设定值(不适用于切换到下一个选项模式)
+
+
diff --git a/ElectronJS/src/taskGrid/logic.js b/ElectronJS/src/taskGrid/logic.js
index e09d935..18431e5 100644
--- a/ElectronJS/src/taskGrid/logic.js
+++ b/ElectronJS/src/taskGrid/logic.js
@@ -184,6 +184,10 @@ function addParameters(t) {
t["parameters"]["waitTime"] = 0; //最长等待时间
t["parameters"]["recordASField"] = 0; //是否记录脚本输出
t["parameters"]["paraType"] = "text"; //记录脚本输出的字段索引
+ } else if (t.option == 6) { //切换下拉选项
+ t["parameters"]["optionMode"] = 0; //下拉模式
+ t["parameters"]["optionValue"] = ""; //下拉值
+ t["parameters"]["index"] = 0; //输入框索引
} else if (t.option == 8) { //循环
t["parameters"]["scrollType"] = 0; //滚动类型,0不滚动,1向下滚动1屏,2滚动到底部
t["parameters"]["scrollCount"] = 1; //滚动次数
@@ -281,6 +285,14 @@ function showError(msg, time=4000) {
}, time);
}
+function showInfo(msg, time=4000) {
+ $("#info_message").text(msg);
+ $("#tipInfo").slideDown(); //提示框
+ let fadeout = setTimeout(function() {
+ $("#tipInfo").slideUp();
+ }, time);
+}
+
//点击确定按钮时的处理
$("#confirm").mousedown(updateUI);
@@ -300,6 +312,9 @@ if (mobile == "true") {
$("#environment").val(1);
}
+let serviceInfo = {
+ "version": "0.3.6"
+};
function saveService(type) {
let serviceId = $("#serviceId").val();
@@ -425,7 +440,7 @@ function saveService(type) {
}
}
}
- let serviceInfo = {
+ serviceInfo = {
"id": parseInt(serviceId),
"name": serviceName,
"url": url,
@@ -488,6 +503,9 @@ if (sId != null && sId != -1) //加载任务
console.log(e);
}
}
+ if(result["version"]!= serviceInfo["version"]){
+ showInfo(LANG("提示:该任务为" + result["version"] + "版本任务,当前版本为" + serviceInfo["version"] + ",可能存在兼容性问题,请按照当前版本指南设计任务流程以避免任务执行不正常。","This task is designed by EasySpider " + result["version"] + ", current version of EasySpider is " + serviceInfo["version"] + ", there may be compatibility issues, please design the task flow according to the current version guide to avoid abnormal task execution."));
+ }
refresh();
});
} else {
diff --git a/ElectronJS/tasks/177.json b/ElectronJS/tasks/177.json
index 54ee54a..b2138f4 100644
--- a/ElectronJS/tasks/177.json
+++ b/ElectronJS/tasks/177.json
@@ -1 +1,343 @@
-{"id":177,"name":"京东全球版-专业的综合网上购物商城","url":"https://www.jd.com","links":"https://www.jd.com","create_time":"7/14/2023, 6:44:54 AM","update_time":"7/14/2023, 7:01:48 AM","version":"0.3.6","saveThreshold":10,"cloudflare":0,"environment":0,"maxViewLength":15,"outputFormat":"xlsx","saveName":"current_time","inputExcel":"","startFromExit":0,"containJudge":false,"desc":"https://www.jd.com","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://www.jd.com","desc":"要采集的网址列表,多行以\\n分开","type":"text","exampleValue":"https://www.jd.com"},{"id":1,"name":"loopTimes_循环_1","nodeId":2,"nodeName":"循环","desc":"循环循环执行的次数(0代表无限循环)","type":"int","exampleValue":0,"value":0}],"outputParameters":[{"id":0,"name":"参数1_文本","desc":"","type":"text","recordASField":1,"exampleValue":"/手机/数码/家用电器/电脑/办公/家纺/家居/厨具/家具/家装/灯具/工业品/内衣/男装/女装/童装/箱包/钟表/珠宝/女鞋/运动/户外/男鞋/汽车用品/车载电器/母婴/洗护喂养/玩具乐器/宠物生活/家庭清洁/个人护理/计生情趣/图书/童书/文学"},{"id":1,"name":"自定义操作","desc":"自定义操作返回的数据","type":"text","recordASField":0,"exampleValue":""},{"id":2,"name":"自定义操作","desc":"自定义操作返回的数据","type":"text","recordASField":0,"exampleValue":""},{"id":3,"name":"自定义操作","desc":"自定义操作返回的数据","type":"text","recordASField":0,"exampleValue":""}],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,4,2],"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","wait":0,"waitType":0},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://www.jd.com","links":"https://www.jd.com","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"cookies":""}},{"id":3,"index":2,"parentId":0,"type":1,"option":8,"title":"循环","sequence":[5,6,3,7],"isInLoop":false,"position":2,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"loopType":0,"pathList":"","textList":"","code":"","waitTime":0,"exitCount":0,"historyWait":2,"breakMode":0,"breakCode":"","breakCodeWaitTime":0}},{"id":6,"index":3,"parentId":3,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":true,"position":2,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"clear":0,"paras":[{"nodeType":0,"contentType":0,"relative":true,"name":"参数1_文本","desc":"","extractType":0,"relativeXPath":"//a[Field[\"自定义操作\"]]","allXPaths":["/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]","//div[contains(., '/手机/数码/家用电')]","//DIV[@class='LeftSide_menu_list__qXCeM']","/html/body/div[last()-6]/div/div[last()-4]/div/div[last()-2]/div/div/div/div[last()-1]"],"exampleValues":[{"num":0,"value":"/手机/数码/家用电器/电脑/办公/家纺/家居/厨具/家具/家装/灯具/工业品/内衣/男装/女装/童装/箱包/钟表/珠宝/女鞋/运动/户外/男鞋/汽车用品/车载电器/母婴/洗护喂养/玩具乐器/宠物生活/家庭清洁/个人护理/计生情趣/图书/童书/文学"}],"unique_index":"6bzoou5h7glk1qcdmv","iframe":false,"default":"","paraType":"text","recordASField":1,"beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}},{"id":2,"index":4,"parentId":0,"type":0,"option":5,"title":"自定义操作","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"clear":0,"codeMode":"5","code":"self.myVar = 0","waitTime":0,"recordASField":0,"paraType":"text"}},{"id":4,"index":5,"parentId":3,"type":0,"option":5,"title":"自定义操作","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"clear":0,"codeMode":"5","code":"self.myVar += 1","waitTime":0,"recordASField":0,"paraType":"text"}},{"id":5,"index":6,"parentId":3,"type":0,"option":5,"title":"自定义操作","sequence":[],"isInLoop":true,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"clear":0,"codeMode":"6","code":"self.myVar","waitTime":0,"recordASField":0,"paraType":"text"}},{"id":7,"index":7,"parentId":3,"type":0,"option":7,"title":"移动到元素","sequence":[],"isInLoop":true,"position":3,"parameters":{"history":1,"tabIndex":0,"useLoop":true,"xpath":"//a[Field[\"自定义操作\"]]","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0}}]}
\ No newline at end of file
+{
+ "id": 177,
+ "name": "京东全球版-专业的综合网上购物商城",
+ "url": "https://www.jd.com",
+ "links": "https://www.jd.com",
+ "create_time": "7/14/2023, 6:44:54 AM",
+ "update_time": "7/14/2023, 7:01:48 AM",
+ "version": "0.3.6",
+ "saveThreshold": 10,
+ "cloudflare": 0,
+ "environment": 0,
+ "maxViewLength": 15,
+ "outputFormat": "xlsx",
+ "saveName": "current_time",
+ "inputExcel": "",
+ "startFromExit": 0,
+ "containJudge": false,
+ "desc": "https://www.jd.com",
+ "inputParameters": [
+ {
+ "id": 0,
+ "name": "urlList_0",
+ "nodeId": 1,
+ "nodeName": "打开网页",
+ "value": "https://www.jd.com",
+ "desc": "要采集的网址列表,多行以\\n分开",
+ "type": "text",
+ "exampleValue": "https://www.jd.com"
+ },
+ {
+ "id": 1,
+ "name": "loopTimes_循环_1",
+ "nodeId": 2,
+ "nodeName": "循环",
+ "desc": "循环循环执行的次数(0代表无限循环)",
+ "type": "int",
+ "exampleValue": 0,
+ "value": 0
+ }
+ ],
+ "outputParameters": [
+ {
+ "id": 0,
+ "name": "参数1_文本",
+ "desc": "",
+ "type": "text",
+ "recordASField": 1,
+ "exampleValue": "/手机/数码/家用电器/电脑/办公/家纺/家居/厨具/家具/家装/灯具/工业品/内衣/男装/女装/童装/箱包/钟表/珠宝/女鞋/运动/户外/男鞋/汽车用品/车载电器/母婴/洗护喂养/玩具乐器/宠物生活/家庭清洁/个人护理/计生情趣/图书/童书/文学"
+ },
+ {
+ "id": 1,
+ "name": "自定义操作",
+ "desc": "自定义操作返回的数据",
+ "type": "text",
+ "recordASField": 0,
+ "exampleValue": ""
+ },
+ {
+ "id": 2,
+ "name": "自定义操作",
+ "desc": "自定义操作返回的数据",
+ "type": "text",
+ "recordASField": 0,
+ "exampleValue": ""
+ },
+ {
+ "id": 3,
+ "name": "自定义操作",
+ "desc": "自定义操作返回的数据",
+ "type": "text",
+ "recordASField": 0,
+ "exampleValue": ""
+ }
+ ],
+ "graph": [
+ {
+ "index": 0,
+ "id": 0,
+ "parentId": 0,
+ "type": -1,
+ "option": 0,
+ "title": "root",
+ "sequence": [
+ 1,
+ 4,
+ 2
+ ],
+ "parameters": {
+ "history": 1,
+ "tabIndex": 0,
+ "useLoop": false,
+ "xpath": "",
+ "wait": 0,
+ "waitType": 0
+ },
+ "isInLoop": false
+ },
+ {
+ "id": 1,
+ "index": 1,
+ "parentId": 0,
+ "type": 0,
+ "option": 1,
+ "title": "打开网页",
+ "sequence": [],
+ "isInLoop": false,
+ "position": 0,
+ "parameters": {
+ "useLoop": false,
+ "xpath": "",
+ "wait": 0,
+ "waitType": 0,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0,
+ "url": "https://www.jd.com",
+ "links": "https://www.jd.com",
+ "maxWaitTime": 10,
+ "scrollType": 0,
+ "scrollCount": 1,
+ "scrollWaitTime": 1,
+ "cookies": ""
+ }
+ },
+ {
+ "id": 3,
+ "index": 2,
+ "parentId": 0,
+ "type": 1,
+ "option": 8,
+ "title": "循环",
+ "sequence": [
+ 5,
+ 6,
+ 3,
+ 7
+ ],
+ "isInLoop": false,
+ "position": 2,
+ "parameters": {
+ "history": 1,
+ "tabIndex": 0,
+ "useLoop": false,
+ "xpath": "/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]",
+ "iframe": false,
+ "wait": 0,
+ "waitType": 0,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0,
+ "scrollType": 0,
+ "scrollCount": 1,
+ "scrollWaitTime": 1,
+ "loopType": 0,
+ "pathList": "",
+ "textList": "",
+ "code": "",
+ "waitTime": 0,
+ "exitCount": 0,
+ "historyWait": 2,
+ "breakMode": 0,
+ "breakCode": "",
+ "breakCodeWaitTime": 0
+ }
+ },
+ {
+ "id": 6,
+ "index": 3,
+ "parentId": 3,
+ "type": 0,
+ "option": 3,
+ "title": "提取数据",
+ "sequence": [],
+ "isInLoop": true,
+ "position": 2,
+ "parameters": {
+ "history": 4,
+ "tabIndex": -1,
+ "useLoop": false,
+ "xpath": "",
+ "iframe": false,
+ "wait": 0,
+ "waitType": 0,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0,
+ "clear": 0,
+ "paras": [
+ {
+ "nodeType": 0,
+ "contentType": 0,
+ "relative": true,
+ "name": "参数1_文本",
+ "desc": "",
+ "extractType": 0,
+ "relativeXPath": "//a[Field[\"自定义操作\"]]",
+ "allXPaths": [
+ "/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]",
+ "//div[contains(., '/手机/数码/家用电')]",
+ "//DIV[@class='LeftSide_menu_list__qXCeM']",
+ "/html/body/div[last()-6]/div/div[last()-4]/div/div[last()-2]/div/div/div/div[last()-1]"
+ ],
+ "exampleValues": [
+ {
+ "num": 0,
+ "value": "/手机/数码/家用电器/电脑/办公/家纺/家居/厨具/家具/家装/灯具/工业品/内衣/男装/女装/童装/箱包/钟表/珠宝/女鞋/运动/户外/男鞋/汽车用品/车载电器/母婴/洗护喂养/玩具乐器/宠物生活/家庭清洁/个人护理/计生情趣/图书/童书/文学"
+ }
+ ],
+ "unique_index": "6bzoou5h7glk1qcdmv",
+ "iframe": false,
+ "default": "",
+ "paraType": "text",
+ "recordASField": 1,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "JS": "",
+ "JSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0,
+ "downloadPic": 0
+ }
+ ]
+ }
+ },
+ {
+ "id": 2,
+ "index": 4,
+ "parentId": 0,
+ "type": 0,
+ "option": 5,
+ "title": "自定义操作",
+ "sequence": [],
+ "isInLoop": false,
+ "position": 1,
+ "parameters": {
+ "history": 1,
+ "tabIndex": 0,
+ "useLoop": false,
+ "xpath": "",
+ "iframe": false,
+ "wait": 0,
+ "waitType": 0,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0,
+ "clear": 0,
+ "codeMode": "5",
+ "code": "self.myVar = 0",
+ "waitTime": 0,
+ "recordASField": 0,
+ "paraType": "text"
+ }
+ },
+ {
+ "id": 4,
+ "index": 5,
+ "parentId": 3,
+ "type": 0,
+ "option": 5,
+ "title": "自定义操作",
+ "sequence": [],
+ "isInLoop": true,
+ "position": 0,
+ "parameters": {
+ "history": 1,
+ "tabIndex": 0,
+ "useLoop": false,
+ "xpath": "",
+ "iframe": false,
+ "wait": 0,
+ "waitType": 0,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0,
+ "clear": 0,
+ "codeMode": "5",
+ "code": "self.myVar += 1",
+ "waitTime": 0,
+ "recordASField": 0,
+ "paraType": "text"
+ }
+ },
+ {
+ "id": 5,
+ "index": 6,
+ "parentId": 3,
+ "type": 0,
+ "option": 5,
+ "title": "自定义操作",
+ "sequence": [],
+ "isInLoop": true,
+ "position": 1,
+ "parameters": {
+ "history": 1,
+ "tabIndex": 0,
+ "useLoop": false,
+ "xpath": "",
+ "iframe": false,
+ "wait": 0,
+ "waitType": 0,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0,
+ "clear": 0,
+ "codeMode": "6",
+ "code": "self.myVar",
+ "waitTime": 0,
+ "recordASField": 0,
+ "paraType": "text"
+ }
+ },
+ {
+ "id": 7,
+ "index": 7,
+ "parentId": 3,
+ "type": 0,
+ "option": 7,
+ "title": "移动到元素",
+ "sequence": [],
+ "isInLoop": true,
+ "position": 3,
+ "parameters": {
+ "history": 1,
+ "tabIndex": 0,
+ "useLoop": true,
+ "xpath": "//a[Field[\"自定义操作\"]]",
+ "iframe": false,
+ "wait": 0,
+ "waitType": 0,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ElectronJS/tasks/178.json b/ElectronJS/tasks/178.json
new file mode 100644
index 0000000..ec33eee
--- /dev/null
+++ b/ElectronJS/tasks/178.json
@@ -0,0 +1 @@
+{"id":178,"name":"京东全球版-专业的综合网上购物商城","url":"https://www.jd.com","links":"https://www.jd.com","create_time":"7/15/2023, 4:06:24 AM","update_time":"7/15/2023, 4:06:24 AM","version":"0.3.6","saveThreshold":10,"cloudflare":0,"environment":0,"maxViewLength":15,"outputFormat":"xlsx","saveName":"current_time","inputExcel":"","startFromExit":0,"containJudge":false,"desc":"https://www.jd.com","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://www.jd.com","desc":"要采集的网址列表,多行以\\n分开","type":"text","exampleValue":"https://www.jd.com"},{"id":1,"name":"loopTimes_循环_1","nodeId":2,"nodeName":"循环","desc":"循环循环执行的次数(0代表无限循环)","type":"int","exampleValue":0,"value":0}],"outputParameters":[],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,2],"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","wait":0,"waitType":0},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://www.jd.com","links":"https://www.jd.com","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"cookies":""}},{"id":2,"index":2,"parentId":0,"type":1,"option":8,"title":"循环","sequence":[3],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"loopType":0,"pathList":"","textList":"","code":"","waitTime":0,"exitCount":0,"historyWait":2,"breakMode":0,"breakCode":"","breakCodeWaitTime":0}},{"id":3,"index":3,"parentId":2,"type":0,"option":6,"title":"切换下拉选项","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":1,"tabIndex":0,"useLoop":true,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"optionMode":0,"optionValue":"","index":2}}]}
\ No newline at end of file
diff --git a/ElectronJS/tasks/179.json b/ElectronJS/tasks/179.json
new file mode 100644
index 0000000..afd880e
--- /dev/null
+++ b/ElectronJS/tasks/179.json
@@ -0,0 +1,159 @@
+{
+ "id": 179,
+ "name": "京东全球版-专业的综合网上购物商城",
+ "url": "https://www.jd.com",
+ "links": "https://www.jd.com",
+ "create_time": "7/15/2023, 4:08:45 AM",
+ "update_time": "7/15/2023, 4:08:45 AM",
+ "version": "0.3.6",
+ "saveThreshold": 10,
+ "cloudflare": 0,
+ "environment": 0,
+ "maxViewLength": 15,
+ "outputFormat": "xlsx",
+ "saveName": "current_time",
+ "inputExcel": "",
+ "startFromExit": 0,
+ "containJudge": false,
+ "desc": "https://www.jd.com",
+ "inputParameters": [
+ {
+ "id": 0,
+ "name": "urlList_0",
+ "nodeId": 1,
+ "nodeName": "打开网页",
+ "value": "https://www.jd.com",
+ "desc": "要采集的网址列表,多行以\\n分开",
+ "type": "text",
+ "exampleValue": "https://www.jd.com"
+ },
+ {
+ "id": 1,
+ "name": "loopTimes_循环_1",
+ "nodeId": 2,
+ "nodeName": "循环",
+ "desc": "循环循环执行的次数(0代表无限循环)",
+ "type": "int",
+ "exampleValue": 0,
+ "value": 0
+ }
+ ],
+ "outputParameters": [],
+ "graph": [
+ {
+ "index": 0,
+ "id": 0,
+ "parentId": 0,
+ "type": -1,
+ "option": 0,
+ "title": "root",
+ "sequence": [
+ 1,
+ 2
+ ],
+ "parameters": {
+ "history": 1,
+ "tabIndex": 0,
+ "useLoop": false,
+ "xpath": "",
+ "wait": 0,
+ "waitType": 0
+ },
+ "isInLoop": false
+ },
+ {
+ "id": 1,
+ "index": 1,
+ "parentId": 0,
+ "type": 0,
+ "option": 1,
+ "title": "打开网页",
+ "sequence": [],
+ "isInLoop": false,
+ "position": 0,
+ "parameters": {
+ "useLoop": false,
+ "xpath": "",
+ "wait": 0,
+ "waitType": 0,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0,
+ "url": "https://www.jd.com",
+ "links": "https://www.jd.com",
+ "maxWaitTime": 10,
+ "scrollType": 0,
+ "scrollCount": 1,
+ "scrollWaitTime": 1,
+ "cookies": ""
+ }
+ },
+ {
+ "id": 2,
+ "index": 2,
+ "parentId": 0,
+ "type": 1,
+ "option": 8,
+ "title": "循环",
+ "sequence": [
+ 3
+ ],
+ "isInLoop": false,
+ "position": 1,
+ "parameters": {
+ "history": 1,
+ "tabIndex": 0,
+ "useLoop": false,
+ "xpath": "",
+ "iframe": false,
+ "wait": 0,
+ "waitType": 0,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0,
+ "scrollType": 0,
+ "scrollCount": 1,
+ "scrollWaitTime": 1,
+ "loopType": 0,
+ "pathList": "",
+ "textList": "",
+ "code": "",
+ "waitTime": 0,
+ "exitCount": 0,
+ "historyWait": 2,
+ "breakMode": 0,
+ "breakCode": "",
+ "breakCodeWaitTime": 0
+ }
+ },
+ {
+ "id": 3,
+ "index": 3,
+ "parentId": 2,
+ "type": 0,
+ "option": 6,
+ "title": "切换下拉选项",
+ "sequence": [],
+ "isInLoop": true,
+ "position": 0,
+ "parameters": {
+ "history": 1,
+ "tabIndex": 0,
+ "useLoop": true,
+ "xpath": "",
+ "iframe": false,
+ "wait": 0,
+ "waitType": 0,
+ "beforeJS": "",
+ "beforeJSWaitTime": 0,
+ "afterJS": "",
+ "afterJSWaitTime": 0,
+ "optionMode": 0,
+ "optionValue": "",
+ "index": 2
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ElectronJS/tasks/180.json b/ElectronJS/tasks/180.json
new file mode 100644
index 0000000..01b0725
--- /dev/null
+++ b/ElectronJS/tasks/180.json
@@ -0,0 +1 @@
+{"id":180,"name":"Switch Select - APK Downloader - Download APK & OBB (Latest Version)","url":"https://apkcombo.com/downloader/","links":"https://apkcombo.com/downloader/","create_time":"","update_time":"7/15/2023, 5:23:55 AM","version":"0.3.6","saveThreshold":10,"cloudflare":0,"environment":0,"maxViewLength":15,"outputFormat":"xlsx","saveName":"current_time","inputExcel":"","startFromExit":0,"containJudge":false,"desc":"https://apkcombo.com/downloader/","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://apkcombo.com/downloader/","desc":"要采集的网址列表,多行以\\n分开","type":"text","exampleValue":"https://apkcombo.com/downloader/"},{"id":1,"name":"loopText_1","nodeId":2,"nodeName":"循环","desc":"要输入的文本/网址,多行以\\n分开","type":"text","exampleValue":"1~3~3","value":"1~3~3"}],"outputParameters":[],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,4,2],"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","wait":0,"waitType":0},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://apkcombo.com/downloader/","links":"https://apkcombo.com/downloader/","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"cookies":""}},{"id":3,"index":2,"parentId":0,"type":1,"option":8,"title":"循环","sequence":[3],"isInLoop":false,"position":2,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"loopType":"3","pathList":"","textList":"1~3~3","code":"","waitTime":0,"exitCount":0,"historyWait":2,"breakMode":0,"breakCode":"","breakCodeWaitTime":0}},{"id":4,"index":3,"parentId":3,"type":0,"option":6,"title":"切换下拉选项","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":true,"xpath":"//*[@id=\"device\"]","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"optionMode":0,"optionValue":"Phone","index":2,"allXPaths":["/html/body/section[1]/div[1]/div[1]/main[1]/form[1]/fieldset[1]/div[1]/div[1]/div[1]/select[1]","//select[contains(., 'Default\nP')]","id(\"device\")","//SELECT[@name='device']","/html/body/section/div[last()-1]/div/main/form/fieldset/div[last()-1]/div[last()-2]/div/select"]}},{"id":2,"index":4,"parentId":0,"type":0,"option":6,"title":"切换下拉选项","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"//*[@id=\"device\"]","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"optionMode":0,"optionValue":"","index":0}}]}
\ No newline at end of file
diff --git a/ExecuteStage/.vscode/launch.json b/ExecuteStage/.vscode/launch.json
index 50f66d8..00f4832 100644
--- a/ExecuteStage/.vscode/launch.json
+++ b/ExecuteStage/.vscode/launch.json
@@ -12,7 +12,7 @@
"justMyCode": false,
// "args": ["--id", "[7]", "--read_type", "remote", "--headless", "0"]
// "args": ["--id", "[9]", "--read_type", "remote", "--headless", "0", "--saved_file_name", "YOUTUBE"]
- "args": ["--id", "[76]", "--headless", "0", "--user_data", "1"]
+ "args": ["--id", "[79]", "--headless", "0", "--user_data", "1"]
}
]
}
\ No newline at end of file
diff --git a/ExecuteStage/easyspider_executestage.py b/ExecuteStage/easyspider_executestage.py
index ffd6fc0..365fa04 100644
--- a/ExecuteStage/easyspider_executestage.py
+++ b/ExecuteStage/easyspider_executestage.py
@@ -45,7 +45,7 @@ from threading import Thread, Event
from myChrome import MyChrome
if sys.platform != "darwin":
from myChrome import MyUCChrome
-from utils import download_image, get_output_code, isnull, lowercase_tags_in_xpath, myMySQL, new_line, on_press_creator, on_release_creator, replace_field_values, write_to_csv, write_to_excel
+from utils import download_image, get_output_code, isnotnull, lowercase_tags_in_xpath, myMySQL, new_line, on_press_creator, on_release_creator, replace_field_values, write_to_csv, write_to_excel
desired_capabilities = DesiredCapabilities.CHROME
desired_capabilities["pageLoadStrategy"] = "none"
@@ -136,7 +136,7 @@ class BrowserThread(Thread):
except:
self.save_threshold = 10
self.links = list(
- filter(isnull, service["links"].split("\n"))) # 要执行的link的列表
+ filter(isnotnull, service["links"].split("\n"))) # 要执行的link的列表
self.OUTPUT = [] # 采集的数据
self.writeMode = 1 # 写入模式,0为新建,1为追加
if self.outputFormat == "csv" or self.outputFormat == "txt":
@@ -554,8 +554,19 @@ class BrowserThread(Thread):
self.OUTPUT.append(line)
def switchSelect(self, para, loopValue):
- optionMode = int(para["optionMode"])
+ optionMode = para["optionMode"]
optionValue = para["optionValue"]
+ if para["useLoop"]:
+ index = para["index"]
+ if index != 0:
+ try:
+ optionValue = loopValue.split("~")[index - 1]
+ except:
+ print("取值失败,可能是因为取值索引超出范围,将使用整个文本值")
+ print("Failed to get value, maybe because the index is out of range, will use the entire text value")
+ else:
+ optionValue = loopValue
+ optionMode = 1
try:
xpath = replace_field_values(para["xpath"], self.outputParameters)
dropdown = Select(self.browser.find_element(
@@ -985,7 +996,7 @@ class BrowserThread(Thread):
elif int(node["parameters"]["loopType"]) == 4: # 固定网址列表
# tempList = node["parameters"]["textList"].split("\r\n")
urlList = list(
- filter(isnull, node["parameters"]["textList"].split("\n"))) # 去空行
+ filter(isnotnull, node["parameters"]["textList"].split("\n"))) # 去空行
# urlList = []
# for url in tempList:
# if url != "":
@@ -1053,8 +1064,8 @@ class BrowserThread(Thread):
# clear output parameters
for key in self.outputParameters:
self.outputParameters[key] = ""
- else:
- url = list(filter(isnull, para["links"].split("\n")))[0]
+ else: # 在流程图其他位置设置了打开网页的操作,读取的应该是第一个网址,如打开网页后登录,再打开第二个网页
+ url = list(filter(isnotnull, para["links"].split("\n")))[0]
# 将value中的Field[""]替换为outputParameters中的键值
url = replace_field_values(url, self.outputParameters)
try:
diff --git a/ExecuteStage/utils.py b/ExecuteStage/utils.py
index 19982f1..39cebea 100644
--- a/ExecuteStage/utils.py
+++ b/ExecuteStage/utils.py
@@ -139,9 +139,7 @@ def get_output_code(output):
return code
# 判断字段是否为空
-
-
-def isnull(s):
+def isnotnull(s):
return len(s) != 0
def new_line(outputParameters, maxViewLength, record):