From 03ac3c59277a55f7ba183c0e0cfeaedd7f91b8ad Mon Sep 17 00:00:00 2001 From: NaiboWang-Alienware Date: Mon, 3 Jul 2023 04:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E8=AF=B4=E6=98=8E=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectronJS/tasks/50.json | 2 +- ExecuteStage/.vscode/launch.json | 2 +- ExecuteStage/Readme.md | 2 +- ExecuteStage/easyspider_executestage.py | 36 ++++++++++++++----------- Extension/README.md | 4 +-- 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/ElectronJS/tasks/50.json b/ElectronJS/tasks/50.json index 6387320..4bf8a2d 100644 --- a/ElectronJS/tasks/50.json +++ b/ElectronJS/tasks/50.json @@ -1 +1 @@ -{"id":50,"name":"中国地震台网——历史查询","url":"http://www.ceic.ac.cn/history","links":"http://www.ceic.ac.cn/history","create_time":"7/1/2023, 3:49:53 PM","version":"0.3.3","containJudge":false,"desc":"http://www.ceic.ac.cn/history","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"http://www.ceic.ac.cn/history","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"http://www.ceic.ac.cn/history"},{"id":1,"name":"inputText_1","nodeName":"输入文字","nodeId":2,"desc":"要输入的文本,如京东搜索框输入:电脑","type":"string","exampleValue":"12","value":"12"},{"id":2,"name":"loopTimes_循环_2","nodeId":4,"nodeName":"循环","desc":"循环循环执行的次数(0代表无限循环)","type":"int","exampleValue":0,"value":0}],"outputParameters":[{"id":0,"name":"参数1_文本","desc":"","type":"string","exampleValue":"3.82023-06-11 17:40:1440.7982.6320新疆阿克苏地区沙雅县"}],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,2,3,4],"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,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"http://www.ceic.ac.cn/history","links":"http://www.ceic.ac.cn/history","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1}},{"id":2,"index":2,"parentId":0,"type":0,"option":4,"title":"输入文字","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[@id=\"weidu1\"]","wait":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"value":"12","allXPaths":["/html/body/div[1]/div[3]/div[1]/div[1]/div[1]/form[1]/div[2]/input[1]","//input[contains(., '')]","id(\"weidu1\")","//INPUT[@class='span1']","//INPUT[@name='weidu1']","/html/body/div[last()-3]/div[last()-1]/div/div/div[last()-1]/form/div[last()-3]/input[last()-1]"]}},{"id":3,"index":3,"parentId":0,"type":0,"option":2,"title":"点击元素","sequence":[],"isInLoop":false,"position":2,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[@id=\"search\"]","wait":2,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"clickWay":0,"maxWaitTime":10,"paras":[],"allXPaths":["/html/body/div[1]/div[3]/div[1]/div[1]/div[1]/form[1]/div[5]/a[1]","//a[contains(., '查询')]","id(\"search\")","//A[@class='check']","/html/body/div[last()-3]/div[last()-1]/div/div/div[last()-1]/form/div/a"]}},{"id":4,"index":4,"parentId":0,"type":1,"option":8,"title":"循环","sequence":[6,5],"isInLoop":false,"position":3,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[contains(@class, \"pagination\")]/ul[1]/li[last()-1]/a[1]","wait":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,"allXPaths":["/html/body/div[1]/div[3]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/div[1]/ul[1]/li[10]/a[1]","//a[contains(., '»')]","/html/body/div[last()-3]/div[last()-1]/div/div/div/div/div/div/div/ul/li[last()-1]/a"]}},{"id":6,"index":5,"parentId":4,"type":0,"option":2,"title":"点击元素","sequence":[],"isInLoop":true,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":true,"xpath":"//*[contains(@class, \"pagination\")]/ul[1]/li[10]/a[1]","wait":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"clickWay":0,"maxWaitTime":10,"paras":[],"allXPaths":["/html/body/div[1]/div[3]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/div[1]/ul[1]/li[10]/a[1]","//a[contains(., '»')]","/html/body/div[last()-3]/div[last()-1]/div/div/div/div/div/div/div/ul/li[last()-1]/a"],"loopType":0}},{"id":5,"index":6,"parentId":4,"type":1,"option":8,"title":"循环","sequence":[7],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"/html/body/div[1]/div[3]/div[1]/div[1]/div[2]/div[1]/div[1]/table[1]/tbody[1]/tr","wait":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":["/html/body/div[1]/div[3]/div[1]/div[1]/div[2]/div[1]/div[1]/table[1]/tbody[1]/tr[1]","//tr[contains(., '震级(M)发震时刻(')]","//TR[@class='speed-tr-h1']","/html/body/div[last()-3]/div[last()-1]/div/div/div/div/div[last()-1]/table/tbody/tr[last()-20]"]}},{"id":7,"index":7,"parentId":5,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"","wait":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":0,"relative":true,"name":"参数1_文本","desc":"","extractType":0,"relativeXPath":"","allXPaths":"","exampleValues":[{"num":0,"value":"3.82023-06-11 17:40:1440.7982.6320新疆阿克苏地区沙雅县"},{"num":1,"value":"震级(M)发震时刻(UTC+8)纬度(°)经度(°)深度(千米)参考位置"},{"num":2,"value":"3.82023-06-18 01:08:1135.8079.7810新疆和田地区和田县"},{"num":3,"value":"4.42023-06-18 00:14:2435.7979.8310新疆和田地区和田县"},{"num":4,"value":"5.62023-06-17 19:35:5947.75147.60430千岛群岛西北"},{"num":5,"value":"5.32023-06-17 08:26:1441.10142.8010日本本州东岸近海"},{"num":6,"value":"3.12023-06-17 08:05:5139.5882.5720新疆阿克苏地区沙雅县"},{"num":7,"value":"3.22023-06-16 01:19:3538.3189.4010新疆巴音郭楞州若羌县"},{"num":8,"value":"3.72023-06-15 21:58:0940.1477.4623新疆克孜勒苏州阿图什市"},{"num":9,"value":"3.62023-06-15 11:21:2732.4494.2410西藏那曲市巴青县"},{"num":10,"value":"6.22023-06-15 10:19:2413.80120.85100菲律宾"},{"num":11,"value":"2.22023-06-14 22:24:4137.12114.7810河北邢台市任泽区"},{"num":12,"value":"3.02023-06-14 13:39:4038.1688.799新疆巴音郭楞州若羌县"},{"num":13,"value":"4.12023-06-14 04:17:5641.7180.8110新疆阿克苏地区温宿县"},{"num":14,"value":"5.22023-06-13 16:03:4333.1075.8020克什米尔地区"},{"num":15,"value":"3.62023-06-13 08:48:3040.1883.8018新疆阿克苏地区沙雅县"},{"num":16,"value":"3.72023-06-13 05:52:5933.1086.7310西藏那曲市尼玛县"},{"num":17,"value":"3.32023-06-12 00:04:1843.3888.9819新疆吐鲁番市高昌区"},{"num":18,"value":"4.32023-06-11 20:25:3824.26122.4727台湾花莲县海域"},{"num":19,"value":"3.62023-06-11 19:29:4548.74129.7917黑龙江伊春市嘉荫县"},{"num":20,"value":"6.22023-06-11 17:54:4542.50142.00130日本北海道"}],"unique_index":"g7lxd23vm1oljjpbdw0","default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}],"loopType":1}}]} \ No newline at end of file +{"id":50,"name":"中国地震台网——历史查询","url":"http://www.ceic.ac.cn/history","links":"http://www.ceic.ac.cn/history","create_time":"7/3/2023, 4:41:12 AM","version":"0.3.5","saveThreshold":10,"cloudflare":0,"environment":0,"containJudge":false,"desc":"http://www.ceic.ac.cn/history","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"http://www.ceic.ac.cn/history","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"http://www.ceic.ac.cn/history"},{"id":1,"name":"inputText_1","nodeName":"输入文字","nodeId":2,"desc":"要输入的文本,如京东搜索框输入:电脑","type":"string","exampleValue":"12","value":"12"},{"id":2,"name":"loopTimes_循环_2","nodeId":4,"nodeName":"循环","desc":"循环循环执行的次数(0代表无限循环)","type":"int","exampleValue":0,"value":0}],"outputParameters":[{"id":0,"name":"参数1_文本","desc":"","type":"string","exampleValue":"3.82023-06-11 17:40:1440.7982.6320新疆阿克苏地区沙雅县"}],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,2,3,4],"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,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"http://www.ceic.ac.cn/history","links":"http://www.ceic.ac.cn/history","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1}},{"id":2,"index":2,"parentId":0,"type":0,"option":4,"title":"输入文字","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[@id=\"weidu1\"]","wait":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"value":"12","allXPaths":["/html/body/div[1]/div[3]/div[1]/div[1]/div[1]/form[1]/div[2]/input[1]","//input[contains(., '')]","id(\"weidu1\")","//INPUT[@class='span1']","//INPUT[@name='weidu1']","/html/body/div[last()-3]/div[last()-1]/div/div/div[last()-1]/form/div[last()-3]/input[last()-1]"]}},{"id":3,"index":3,"parentId":0,"type":0,"option":2,"title":"点击元素","sequence":[],"isInLoop":false,"position":2,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[@id=\"search\"]","wait":2,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"clickWay":0,"maxWaitTime":10,"paras":[],"allXPaths":["/html/body/div[1]/div[3]/div[1]/div[1]/div[1]/form[1]/div[5]/a[1]","//a[contains(., '查询')]","id(\"search\")","//A[@class='check']","/html/body/div[last()-3]/div[last()-1]/div/div/div[last()-1]/form/div/a"]}},{"id":4,"index":4,"parentId":0,"type":1,"option":8,"title":"循环","sequence":[6,5],"isInLoop":false,"position":3,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[contains(@class, \"pagination\")]/ul[1]/li[last()-1]/a[1]","wait":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,"allXPaths":["/html/body/div[1]/div[3]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/div[1]/ul[1]/li[10]/a[1]","//a[contains(., '»')]","/html/body/div[last()-3]/div[last()-1]/div/div/div/div/div/div/div/ul/li[last()-1]/a"]}},{"id":6,"index":5,"parentId":4,"type":0,"option":2,"title":"点击元素","sequence":[],"isInLoop":true,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":true,"xpath":"//*[contains(@class, \"pagination\")]/ul[1]/li[10]/a[1]","wait":2,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"clickWay":0,"maxWaitTime":10,"paras":[],"allXPaths":["/html/body/div[1]/div[3]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/div[1]/ul[1]/li[10]/a[1]","//a[contains(., '»')]","/html/body/div[last()-3]/div[last()-1]/div/div/div/div/div/div/div/ul/li[last()-1]/a"],"loopType":0,"waitType":"1"}},{"id":5,"index":6,"parentId":4,"type":1,"option":8,"title":"循环","sequence":[7],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"/html/body/div[1]/div[3]/div[1]/div[1]/div[2]/div[1]/div[1]/table[1]/tbody[1]/tr","wait":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":["/html/body/div[1]/div[3]/div[1]/div[1]/div[2]/div[1]/div[1]/table[1]/tbody[1]/tr[1]","//tr[contains(., '震级(M)发震时刻(')]","//TR[@class='speed-tr-h1']","/html/body/div[last()-3]/div[last()-1]/div/div/div/div/div[last()-1]/table/tbody/tr[last()-20]"]}},{"id":7,"index":7,"parentId":5,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"","wait":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":0,"relative":true,"name":"参数1_文本","desc":"","extractType":0,"relativeXPath":"","allXPaths":"","exampleValues":[{"num":0,"value":"3.82023-06-11 17:40:1440.7982.6320新疆阿克苏地区沙雅县"},{"num":1,"value":"震级(M)发震时刻(UTC+8)纬度(°)经度(°)深度(千米)参考位置"},{"num":2,"value":"3.82023-06-18 01:08:1135.8079.7810新疆和田地区和田县"},{"num":3,"value":"4.42023-06-18 00:14:2435.7979.8310新疆和田地区和田县"},{"num":4,"value":"5.62023-06-17 19:35:5947.75147.60430千岛群岛西北"},{"num":5,"value":"5.32023-06-17 08:26:1441.10142.8010日本本州东岸近海"},{"num":6,"value":"3.12023-06-17 08:05:5139.5882.5720新疆阿克苏地区沙雅县"},{"num":7,"value":"3.22023-06-16 01:19:3538.3189.4010新疆巴音郭楞州若羌县"},{"num":8,"value":"3.72023-06-15 21:58:0940.1477.4623新疆克孜勒苏州阿图什市"},{"num":9,"value":"3.62023-06-15 11:21:2732.4494.2410西藏那曲市巴青县"},{"num":10,"value":"6.22023-06-15 10:19:2413.80120.85100菲律宾"},{"num":11,"value":"2.22023-06-14 22:24:4137.12114.7810河北邢台市任泽区"},{"num":12,"value":"3.02023-06-14 13:39:4038.1688.799新疆巴音郭楞州若羌县"},{"num":13,"value":"4.12023-06-14 04:17:5641.7180.8110新疆阿克苏地区温宿县"},{"num":14,"value":"5.22023-06-13 16:03:4333.1075.8020克什米尔地区"},{"num":15,"value":"3.62023-06-13 08:48:3040.1883.8018新疆阿克苏地区沙雅县"},{"num":16,"value":"3.72023-06-13 05:52:5933.1086.7310西藏那曲市尼玛县"},{"num":17,"value":"3.32023-06-12 00:04:1843.3888.9819新疆吐鲁番市高昌区"},{"num":18,"value":"4.32023-06-11 20:25:3824.26122.4727台湾花莲县海域"},{"num":19,"value":"3.62023-06-11 19:29:4548.74129.7917黑龙江伊春市嘉荫县"},{"num":20,"value":"6.22023-06-11 17:54:4542.50142.00130日本北海道"}],"unique_index":"g7lxd23vm1oljjpbdw0","default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}],"loopType":1}}]} \ No newline at end of file diff --git a/ExecuteStage/.vscode/launch.json b/ExecuteStage/.vscode/launch.json index aa6833a..ba489fc 100644 --- a/ExecuteStage/.vscode/launch.json +++ b/ExecuteStage/.vscode/launch.json @@ -10,7 +10,7 @@ "program": "${file}", "console": "integratedTerminal", "justMyCode": true, - "args": ["--id", "[117]", "--read_type", "remote", "--headless", "0"] + "args": ["--id", "[1]", "--read_type", "remote", "--headless", "0"] // "args": ["--id", "[44]", "--headless", "0", "--user_data", "1"] } ] diff --git a/ExecuteStage/Readme.md b/ExecuteStage/Readme.md index 395fad5..3acc738 100644 --- a/ExecuteStage/Readme.md +++ b/ExecuteStage/Readme.md @@ -64,7 +64,7 @@ The above is an example command to run a task with the ID of `1`. For more infor ### VS Code调试/VS Code Debug -可以用VS Code打开此文件夹即可调试程序,可修改`.vscode`下的`launch.json`文件中的调试参数,调试说明参考:https://zhuanlan.zhihu.com/p/41189402 +可以用VS Code打开此文件夹即可调试程序,可修改`.vscode`下的`launch.json`文件中的调试参数,调试说明参考:[https://zhuanlan.zhihu.com/p/41189402](https://zhuanlan.zhihu.com/p/41189402)。 You can use VS Code to open this folder and debug the program. You can modify the debugging parameters in the launch.json file located under the .vscode folder. For instructions on debugging with VSCode, you can refer to this guide: [Debugging Python with Visual Studio Code](https://code.visualstudio.com/docs/python/debugging). diff --git a/ExecuteStage/easyspider_executestage.py b/ExecuteStage/easyspider_executestage.py index f2695fd..8421267 100644 --- a/ExecuteStage/easyspider_executestage.py +++ b/ExecuteStage/easyspider_executestage.py @@ -45,9 +45,9 @@ desired_capabilities["pageLoadStrategy"] = "none" # 控制流程的暂停和继续 -def check_pause(event): +def check_pause(key, event): while True: - if keyboard.is_pressed('p'): # 按下p键,暂停程序 + if keyboard.is_pressed(key): # 按下p键,暂停程序 if event._flag == False: print("任务执行中,长按p键暂停执行。") print("Task is running, long press 'p' to pause.") @@ -1106,19 +1106,23 @@ class BrowserThread(Thread): for result in content if result.strip()) else: content = p["default"] - try: - if not self.dataNotFoundKeys[p["name"]]: - print('Element %s not found with parameter name %s when extracting data, use default, this error will only show once' % ( - p["relativeXPath"], p["name"])) - print("提取数据操作时,字段名 %s 对应XPath %s 未找到,使用默认值,本字段将不再重复报错" % ( - p["name"], p["relativeXPath"])) - self.dataNotFoundKeys[p["name"]] = True - self.recordLog( - 'Element %s not found, use default' % p["relativeXPath"]) - except: - pass + if not self.dataNotFoundKeys[p["name"]]: + print('Element %s not found with parameter name %s when extracting data, use default, this error will only show once' % ( + p["relativeXPath"], p["name"])) + print("提取数据操作时,字段名 %s 对应XPath %s 未找到,使用默认值,本字段将不再重复报错" % ( + p["name"], p["relativeXPath"])) + self.dataNotFoundKeys[p["name"]] = True + self.recordLog( + 'Element %s not found, use default' % p["relativeXPath"]) except Exception as e: - print(e) + if not self.dataNotFoundKeys[p["name"]]: + print('Element %s not found with parameter name %s when extracting data, use default, this error will only show once' % ( + p["relativeXPath"], p["name"])) + print("提取数据操作时,字段名 %s 对应XPath %s 未找到,使用默认值,本字段将不再重复报错" % ( + p["name"], p["relativeXPath"])) + self.dataNotFoundKeys[p["name"]] = True + self.recordLog( + 'Element %s not found, use default' % p["relativeXPath"]) self.outputParameters[p["name"]] = content # 对于不能优化的操作,使用selenium执行 @@ -1350,7 +1354,7 @@ if __name__ == '__main__': if not os.path.exists("Data/" + str(i)): os.mkdir("Data/" + str(i)) if not os.path.exists("Data/" + str(i) + "/" + saveName): - os.mkdir("Data/" + saveName) # 创建保存文件夹用来保存截图 + os.mkdir("Data/" + str(i) + "/" + saveName) # 创建保存文件夹用来保存截图 if c.read_type == "remote": print("remote") content = requests.get( @@ -1405,7 +1409,7 @@ if __name__ == '__main__': print("Thread with task id: ", i, " is created") threads.append(thread) thread.start() - Thread(target=check_pause, args=(event)).start() + Thread(target=check_pause, args=("p", event)).start() time.sleep(5) print("\n\n----------------------------------") print("正在运行任务,长按键盘p键可暂停任务的执行以便手工操作浏览器如输入验证码;如果想恢复任务的执行,请再次长按p键。") diff --git a/Extension/README.md b/Extension/README.md index a95ac56..2aa1ea1 100644 --- a/Extension/README.md +++ b/Extension/README.md @@ -44,7 +44,7 @@ npm install npm run dev ``` -打开一个Chrome浏览器窗口,然后在浏览器地址栏输入`chrome://extensions/`,在打开的页面中,打开右上角的`开发者模式`,点击`加载已解压的扩展程序`,选择`manifest_v3\dist`文件夹,即可加载扩展。 +打开一个Chrome浏览器窗口,然后在浏览器地址栏输入`chrome://extensions/`,在打开的页面中,打开右上角的`开发者模式`,点击`加载已解压的扩展程序`,选择`manifest_v3/dist`文件夹,即可加载扩展。 ----- @@ -54,7 +54,7 @@ Run the following command to hot reload the extension: npm run dev ``` -Open a Chrome browser window, then enter `chrome://extensions/` in the browser address bar. On the opened page, open the `Developer mode` in the upper right corner, click `Load unpacked` and select the `manifest_v3\dist` folder to load the extension. +Open a Chrome browser window, then enter `chrome://extensions/` in the browser address bar. On the opened page, open the `Developer mode` in the upper right corner, click `Load unpacked` and select the `manifest_v3/dist` folder to load the extension. ## 打包扩展/Package the extension