From cbf48d4426a17bea45c3ade9d4569c2fcec13b5e Mon Sep 17 00:00:00 2001 From: NaiboWang-Alienware Date: Wed, 5 Jul 2023 21:05:05 +0800 Subject: [PATCH] Debug when production --- ElectronJS/.gitignore | 1 + ElectronJS/config.json | 8 +++++++- ElectronJS/main.js | 15 +++++++++++++++ ElectronJS/tasks/131.json | 2 +- ElectronJS/tasks/139.json | 1 + ElectronJS/tasks/140.json | 1 + ExecuteStage/.vscode/launch.json | 2 +- 7 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 ElectronJS/tasks/139.json create mode 100644 ElectronJS/tasks/140.json diff --git a/ElectronJS/.gitignore b/ElectronJS/.gitignore index e71c814a..6e34c961 100644 --- a/ElectronJS/.gitignore +++ b/ElectronJS/.gitignore @@ -12,4 +12,5 @@ Data/ Chrome/ execution_instances/* .DS_Store +info.log npminstall-debug.log diff --git a/ElectronJS/config.json b/ElectronJS/config.json index 522f720d..1a370f8b 100644 --- a/ElectronJS/config.json +++ b/ElectronJS/config.json @@ -1 +1,7 @@ -{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data","absolute_user_data_folder":"D:\\Document\\Projects\\EasySpider\\ElectronJS\\user_data"} \ No newline at end of file +{ + "webserver_address": "http://localhost", + "webserver_port": 8074, + "user_data_folder": "./user_data", + "debug": true, + "absolute_user_data_folder": "D:\\Document\\Projects\\EasySpider\\ElectronJS\\user_data" +} diff --git a/ElectronJS/main.js b/ElectronJS/main.js index e1b64a54..f62e5d0b 100644 --- a/ElectronJS/main.js +++ b/ElectronJS/main.js @@ -11,9 +11,24 @@ const fs = require('fs'); const {exec} = require('child_process'); const iconPath = path.join(__dirname, 'favicon.ico'); const task_server = require(path.join(__dirname, 'server.js')); +const util = require('util'); let config = fs.readFileSync(path.join(task_server.getDir(), `config.json`), 'utf8'); config = JSON.parse(config); + +if(config.debug){ + let logPath = 'info.log' + let logFile = fs.createWriteStream(logPath, { flags: 'a' }) + console.log = function() { + logFile.write(util.format.apply(null, arguments) + '\n') + process.stdout.write(util.format.apply(null, arguments) + '\n') + } + console.error = function() { + logFile.write(util.format.apply(null, arguments) + '\n') + process.stderr.write(util.format.apply(null, arguments) + '\n') + } +} + task_server.start(config.webserver_port); //start local server let server_address = `${config.webserver_address}:${config.webserver_port}`; const websocket_port = 8084; //目前只支持8084端口,写死,因为扩展里面写死了 diff --git a/ElectronJS/tasks/131.json b/ElectronJS/tasks/131.json index f4cb671e..9fb628d6 100644 --- a/ElectronJS/tasks/131.json +++ b/ElectronJS/tasks/131.json @@ -1 +1 @@ -{"id":131,"name":"发现自己误成间谍帮手后主动投案 - 搜狗搜索","url":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","links":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","create_time":"7/5/2023, 6:00:44 AM","version":"0.3.5","saveThreshold":10,"cloudflare":0,"environment":0,"containJudge":false,"desc":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001"}],"outputParameters":[{"id":0,"name":"参数1_文本","desc":"","type":"string","exampleValue":"发现自己误成间谍帮手后主动投案"}],"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},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":5,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","links":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1}},{"id":2,"index":2,"parentId":0,"type":1,"option":8,"title":"循环","sequence":[3,4],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"/html/body/div[3]/div[2]/div[2]/div[1]/div[1]/div[2]/ol[1]/li/span[1]/p[1]","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"loopType":1,"pathList":"","textList":"","code":"","waitTime":0,"exitCount":0,"historyWait":2,"breakMode":0,"breakCode":"","breakCodeWaitTime":0,"allXPaths":""}},{"id":3,"index":3,"parentId":2,"type":0,"option":2,"title":"点击元素","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":true,"xpath":"/html/body/div[3]/div[2]/div[2]/div[1]/div[1]/div[2]/ol[1]/li/span[1]/p[1]","iframe":false,"wait":2,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"clickWay":0,"maxWaitTime":10,"paras":[],"allXPaths":"","loopType":1}},{"id":4,"index":4,"parentId":2,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":true,"position":1,"parameters":{"history":1,"tabIndex":-1,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":3,"contentType":0,"relative":false,"name":"参数1_文本","desc":"","extractType":0,"relativeXPath":"/html/body/div[3]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/input[1]","allXPaths":["/html/body/div[3]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/input[1]","//input[contains(., '')]","id(\"upquery\")","//INPUT[@class='query']","//INPUT[@name='query']","/html/body/div[last()-3]/div[last()-5]/div/form[last()-1]/div/div/div/input"],"exampleValues":[{"num":0,"value":"发现自己误成间谍帮手后主动投案"}],"unique_index":"26fghtlzmtaljosmf5q","iframe":false,"default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}}]} \ No newline at end of file +{"id":131,"name":"发现自己误成间谍帮手后主动投案 - 搜狗搜索","url":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","links":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","create_time":"7/5/2023, 9:01:25 PM","version":"0.3.5","saveThreshold":10,"cloudflare":0,"environment":0,"containJudge":false,"desc":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001"}],"outputParameters":[{"id":0,"name":"参数1_文本","desc":"","type":"string","exampleValue":"发现自己误成间谍帮手后主动投案"}],"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},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":5,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","links":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1}},{"id":2,"index":2,"parentId":0,"type":1,"option":8,"title":"循环","sequence":[3,4],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"/html/body/div[3]/div[2]/div[2]/div[1]/div[1]/div[2]/ol[1]/li/span[1]/p[1]","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"loopType":1,"pathList":"","textList":"","code":"","waitTime":0,"exitCount":0,"historyWait":2,"breakMode":0,"breakCode":"","breakCodeWaitTime":0,"allXPaths":""}},{"id":3,"index":3,"parentId":2,"type":0,"option":2,"title":"点击元素","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":true,"xpath":"/html/body/div[3]/div[2]/div[2]/div[1]/div[1]/div[2]/ol[1]/li/span[1]/p[1]","iframe":false,"wait":2,"waitType":0,"beforeJS":"arguments[0].innerText+=\"TTT\"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"clickWay":0,"maxWaitTime":10,"paras":[],"allXPaths":"","loopType":1}},{"id":4,"index":4,"parentId":2,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":true,"position":1,"parameters":{"history":1,"tabIndex":-1,"useLoop":false,"xpath":"","iframe":false,"wait":2,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":3,"contentType":0,"relative":false,"name":"参数1_文本","desc":"","extractType":0,"relativeXPath":"/html/body/div[3]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/input[1]","allXPaths":["/html/body/div[3]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/input[1]","//input[contains(., '')]","id(\"upquery\")","//INPUT[@class='query']","//INPUT[@name='query']","/html/body/div[last()-3]/div[last()-5]/div/form[last()-1]/div/div/div/input"],"exampleValues":[{"num":0,"value":"发现自己误成间谍帮手后主动投案"}],"unique_index":"26fghtlzmtaljosmf5q","iframe":false,"default":"","beforeJS":"arguments[0].value+=\"TTT\"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}}]} \ No newline at end of file diff --git a/ElectronJS/tasks/139.json b/ElectronJS/tasks/139.json new file mode 100644 index 00000000..9f07b452 --- /dev/null +++ b/ElectronJS/tasks/139.json @@ -0,0 +1 @@ +{"id":139,"name":"京东全球版-专业的综合网上购物商城","url":"https://www.jd.com","links":"https://www.jd.com","create_time":"7/5/2023, 8:59:32 PM","version":"0.3.5","saveThreshold":10,"cloudflare":0,"environment":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":"string","exampleValue":"https://www.jd.com"}],"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},"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}},{"id":2,"index":2,"parentId":0,"type":1,"option":8,"title":"循环","sequence":[3,4],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div/a","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"loopType":1,"pathList":"","textList":"","code":"","waitTime":0,"exitCount":0,"historyWait":2,"breakMode":0,"breakCode":"","breakCodeWaitTime":0,"allXPaths":""}},{"id":3,"index":3,"parentId":2,"type":0,"option":2,"title":"点击元素","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":true,"xpath":"/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div/a","iframe":false,"wait":4,"waitType":0,"beforeJS":"arguments[0].innerText += \"类别\"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"clickWay":0,"maxWaitTime":10,"paras":[],"allXPaths":"","loopType":1}},{"id":4,"index":4,"parentId":2,"type":0,"option":5,"title":"自定义操作","sequence":[],"isInLoop":true,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":3,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"codeMode":0,"code":"document.body.innerText = \"1\"","waitTime":0,"recordASField":0}}]} \ No newline at end of file diff --git a/ElectronJS/tasks/140.json b/ElectronJS/tasks/140.json new file mode 100644 index 00000000..3b61107b --- /dev/null +++ b/ElectronJS/tasks/140.json @@ -0,0 +1 @@ +{"id":140,"name":"发现自己误成间谍帮手后主动投案 - 搜狗搜索","url":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","links":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","create_time":"7/5/2023, 9:03:46 PM","version":"0.3.5","saveThreshold":10,"cloudflare":0,"environment":0,"containJudge":false,"desc":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001"}],"outputParameters":[{"id":0,"name":"参数1_文本","desc":"","type":"string","exampleValue":"重庆万州洪涝因灾死亡15人"}],"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},"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.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","links":"https://www.sogou.com/web?query=%E5%8F%91%E7%8E%B0%E8%87%AA%E5%B7%B1%E8%AF%AF%E6%88%90%E9%97%B4%E8%B0%8D%E5%B8%AE%E6%89%8B%E5%90%8E%E4%B8%BB%E5%8A%A8%E6%8A%95%E6%A1%88&_asf=www.sogou.com&_ast=&w=01015002&p=40040108&ie=utf8&from=index-nologin&s_from=index&oq=&ri=0&sourceid=sugg&suguuid=&stj=0%3B15%3B0%3B0&stj2=0&stj0=0&stj1=15&hp=186&hp1=&suglabid=suglabId_1&sut=5593&sst0=1688505472858&lkt=2%2C1688505467266%2C1688505467275&sugsuv=1688505456057167&sugtime=1688505472858&pid=sogou-wsse-af5baf594e9197b4-0001","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1}},{"id":2,"index":2,"parentId":0,"type":1,"option":8,"title":"循环","sequence":[3,4],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"/html/body/div[3]/div[2]/div[2]/div[1]/div[1]/div[2]/ol[1]/li/span[1]/p[1]/a[1]","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"loopType":1,"pathList":"","textList":"","code":"","waitTime":0,"exitCount":0,"historyWait":2,"breakMode":0,"breakCode":"","breakCodeWaitTime":0,"allXPaths":""}},{"id":3,"index":3,"parentId":2,"type":0,"option":2,"title":"点击元素","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":true,"xpath":"/html/body/div[3]/div[2]/div[2]/div[1]/div[1]/div[2]/ol[1]/li/span[1]/p[1]/a[1]","iframe":false,"wait":2,"waitType":0,"beforeJS":"arguments[0].innerText += \"TTT\"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"clickWay":0,"maxWaitTime":10,"paras":[],"allXPaths":"","loopType":1}},{"id":4,"index":4,"parentId":2,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":true,"position":1,"parameters":{"history":1,"tabIndex":-1,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":3,"contentType":0,"relative":false,"name":"参数1_文本","desc":"","extractType":0,"relativeXPath":"/html/body/div[3]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/input[1]","allXPaths":["/html/body/div[3]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/input[1]","//input[contains(., '')]","id(\"upquery\")","//INPUT[@class='query']","//INPUT[@name='query']","/html/body/div[last()-3]/div[last()-5]/div/form[last()-1]/div/div/div/input"],"exampleValues":[{"num":0,"value":"重庆万州洪涝因灾死亡15人"}],"unique_index":"ucvbjlr9jsljpqc50d","iframe":false,"default":"","beforeJS":"arguments[0].value += \"TTT\"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}}]} \ No newline at end of file diff --git a/ExecuteStage/.vscode/launch.json b/ExecuteStage/.vscode/launch.json index 2da5fd37..504b2db2 100644 --- a/ExecuteStage/.vscode/launch.json +++ b/ExecuteStage/.vscode/launch.json @@ -10,7 +10,7 @@ "program": "${file}", "console": "integratedTerminal", "justMyCode": true, - "args": ["--id", "[95]", "--read_type", "remote", "--headless", "0"] + "args": ["--id", "[1]", "--read_type", "remote", "--headless", "0"] // "args": ["--id", "[2]", "--read_type", "remote", "--headless", "0", "--saved_file_name", "YOUTUBE"] // "args": ["--id", "[44]", "--headless", "0", "--user_data", "1"] }