Naibo Wang 2 years ago
parent
commit
4e87c081c6
36 changed files with 79 additions and 11 deletions
  1. 1 1
      .gitignore
  2. 25 0
      ElectronJS/README.md
  3. 11 8
      ElectronJS/main.js
  4. 15 0
      ElectronJS/package_linux64.sh
  5. 5 0
      ExecuteStage/generateExecutable_Linux64.sh
  6. 1 0
      Releases/EasySpider_linux_amd64_Ubuntu/.gitignore
  7. 1 0
      Releases/EasySpider_linux_amd64_Ubuntu/config.json
  8. 1 0
      Releases/EasySpider_linux_amd64_Ubuntu/easy-spider.sh
  9. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/execution_instances/0.json
  10. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/execution_instances/1.json
  11. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/execution_instances/2.json
  12. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/execution_instances/3.json
  13. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/execution_instances/4.json
  14. 12 0
      Releases/EasySpider_linux_amd64_Ubuntu/readme.txt
  15. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/11.json
  16. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/15.json
  17. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/16.json
  18. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/17.json
  19. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/19.json
  20. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/2.json
  21. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/20.json
  22. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/23.json
  23. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/25.json
  24. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/27.json
  25. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/28.json
  26. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/29.json
  27. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/30.json
  28. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/31.json
  29. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/32.json
  30. 1 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/33.json
  31. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/4.json
  32. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/5.json
  33. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/6.json
  34. 0 0
      Releases/EasySpider_linux_amd64_Ubuntu/tasks/7.json
  35. 3 1
      Releases/EasySpider_windows_386/readme.txt
  36. 3 1
      Releases/EasySpider_windows_amd64/readme.txt

+ 1 - 1
.gitignore

@@ -8,4 +8,4 @@ old_code/
 *.ini
 *.7z
 *.mp4
-
+*.tar.xz

+ 25 - 0
ElectronJS/README.md

@@ -2,6 +2,31 @@
 
 Remember to update EasySpider.crx everytime the extension updates.
 
+## Prerequisite
+
+Download a chrome from the Internet: https://www.google.com/chrome/, and then put them into this folder, with name format of the following:
+
+```
+chrome_win32/ # for windows x86
+chrome_win64/ # for windows x64
+chrome_linux64/ # for linux x64
+chrome_mac64/ # for mac x64
+```
+
+Then, download the corresponding chromedriver from the Internet on this page: https://chromedriver.chromium.org/downloads, note the **chromedriver version must match your chrome version**!!! And put them into corresponding chrome folder, with name format of the following:
+
+```
+chromedriver_win32.exe # for windows x86
+chromedriver_win64.exe # for windows x64
+chromedriver_linux64 # for linux x64
+chromedriver_mac64 # for mac x64
+```
+
+For example, if you want to build this software on Windows x64 platform, then you should first download a chrome for windows x64, then copy the whole `chrome` folder to this `ElectronJS` folder and rename the folder to `chrome_win64`, assume the chrome version you downloaded is 110; then, download a `chromedriver.exe` with version 110 for windows x64, and put it into the `chrome_win64` folder, then rename it to `chromedriver_win64.exe`.
+
+
+Finally, copy the `stealth.min.js` file in this folder to all of these `chrome` folders.
+
 ## Run Instruction
 
 On Windows, you need to install `VS Build Tools 2017` (double click the vs_BuildTools.exe in this folder, then select and install the `Visual Studio Build Tools 2017` component) first for node-gyp to install `node-windows-manager`.

+ 11 - 8
ElectronJS/main.js

@@ -32,7 +32,7 @@ if (process.platform === 'win32' && process.arch === 'ia32') {
 } else if (process.platform === 'linux') {
   driverPath = path.join(__dirname, "chrome_linux64/chromedriver_linux64");
   chromeBinaryPath = path.join(__dirname, "chrome_linux64/chrome");
-  execute_path = path.join(__dirname, "chrome_linux64/easyspider_executestage");
+  execute_path = path.join(__dirname, "chrome_linux64/execute.sh");
 }
 console.log(driverPath, chromeBinaryPath, execute_path);
 let language = "en";
@@ -100,15 +100,18 @@ function beginInvoke(msg) {
     mainWindow.hide();
     const window = windowManager.getActiveWindow();
   // Prints the currently focused window bounds.
-    console.log(window.getBounds());
+    console.log(window);
   // This method has to be called on macOS before changing the window's bounds, otherwise it will throw an error.
   // It will prompt an accessibility permission request dialog, if needed.
-    windowManager.requestAccessibility();
-  // Sets the active window's bounds.
-    let size = screen.getPrimaryDisplay().workAreaSize
-    let width = parseInt(size.width)
-    let height = parseInt(size.height * 0.6)
-    window.setBounds({ x: 0, y: size.height * 0.4, height:height, width:width });
+    if(window != undefined){
+      windowManager.requestAccessibility();
+      // Sets the active window's bounds.
+        let size = screen.getPrimaryDisplay().workAreaSize
+        let width = parseInt(size.width)
+        let height = parseInt(size.height * 0.6)
+        window.setBounds({ x: 0, y: size.height * 0.4, height:height, width:width });
+    }
+    
     flowchart_window.show();
   } else if (msg.type == 2) {
     //keyboard

+ 15 - 0
ElectronJS/package_linux64.sh

@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# This script is used to build the package for Linux 64-bit.
+rm -r out
+npm run package
+mv out/EasySpider-linux-x64 out/EasySpider
+rm -r out/EasySpider/resources/app/chrome_win64
+rm -r out/EasySpider/resources/app/Data
+rm -r out/EasySpider/resources/app/.idea
+rm -r out/EasySpider/resources/app/tasks
+rm -r out/EasySpider/resources/app/execution_instances
+rm -r out/EasySpider/resources/app/user_data
+rm -r ../Releases/EasySpider_linux_amd64_Ubuntu/EasySpider
+rm out/EasySpider/resources/app/vs_BuildTools.exe
+mv out/EasySpider ../Releases/EasySpider_linux_amd64_Ubuntu/EasySpider

+ 5 - 0
ExecuteStage/generateExecutable_Linux64.sh

@@ -0,0 +1,5 @@
+rm -r build
+rm -r dist
+pyinstaller -F --icon=favicon.ico easyspider_executestage.py
+rm ../ElectronJS/chrome_linux64/easyspider_executestage
+mv dist/easyspider_executestage ../ElectronJS/chrome_linux64/easyspider_executestage

+ 1 - 0
Releases/EasySpider_linux_amd64_Ubuntu/.gitignore

@@ -0,0 +1 @@
+EasySpider/

+ 1 - 0
Releases/EasySpider_linux_amd64_Ubuntu/config.json

@@ -0,0 +1 @@
+{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data"}

+ 1 - 0
Releases/EasySpider_linux_amd64_Ubuntu/easy-spider.sh

@@ -0,0 +1 @@
+./EasySpider/EasySpider

File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/execution_instances/0.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/execution_instances/1.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/execution_instances/2.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/execution_instances/3.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/execution_instances/4.json


+ 12 - 0
Releases/EasySpider_linux_amd64_Ubuntu/readme.txt

@@ -0,0 +1,12 @@
+在此文件夹下打开Linux Terimal, 并输入以下命令运行软件:
+./easy-spider.sh
+注意软件运行过程中不要关闭terminal。
+
+To open the EasySpider, please open your terminal, and then type:
+./easy-spider.sh
+Then EasySpider will be opened, and don't close the terminal when running EasySpider.
+
+
+可以从其他机器导入任务,只需要把其他机器的tasks文件夹里的.json文件放入此目录的tasks文件夹里即可。同理执行号文件可以通过复制execution_instances文件夹中的.json文件来导入。注意,两个文件夹里的.json文件只支持命名为大于0的数字。
+
+Tasks can be imported from other machines by simply placing the .json files from the "tasks" folder of those machines into the "tasks" folder of this directory. Similarly, execution instance files can be imported by copying the .json files from the "execution_instances" folder. Note that only files named with a number greater than 0 are supported in both folders.

File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/11.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/15.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/16.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/17.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/19.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/2.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/20.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/23.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/25.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/27.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/28.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/29.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/30.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/31.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/32.json


+ 1 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/33.json

@@ -0,0 +1 @@
+{"id":33,"name":"JD","url":"https://www.jd.com","links":"https://www.jd.com","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"},{"id":1,"name":"inputText_1","nodeName":"输入文字","nodeId":2,"desc":"要输入的文本,如京东搜索框输入:电脑","type":"string","exampleValue":"123","value":"123"}],"outputParameters":[],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,2,3],"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,"url":"https://www.jd.com","links":"https://www.jd.com","scrollType":0,"scrollCount":0}},{"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=\"key\"]","wait":0,"value":"123"}},{"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-btn\"]/i[1]","wait":0,"scrollType":0,"scrollCount":0,"paras":[]}}]}

File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/4.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/5.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/6.json


File diff suppressed because it is too large
+ 0 - 0
Releases/EasySpider_linux_amd64_Ubuntu/tasks/7.json


+ 3 - 1
Releases/EasySpider_windows_386/readme.txt

@@ -3,4 +3,6 @@
 The software is totally not trojan/virus! If mistaken by antivirus software such as windows defender as a virus, please recover it, or open "EasySpider.bat" to run our software instead.
 
 
-可以从其他机器导入任务,只需要把其他机器的tasks文件夹里的.json文件放入此目录的tasks文件夹里即可。同理执行号文件可以通过复制execution_instances文件夹中的.json文件来导入。注意,两个文件夹里的.json文件只支持命名为大于0的数字。
+可以从其他机器导入任务,只需要把其他机器的tasks文件夹里的.json文件放入此目录的tasks文件夹里即可。同理执行号文件可以通过复制execution_instances文件夹中的.json文件来导入。注意,两个文件夹里的.json文件只支持命名为大于0的数字。
+
+Tasks can be imported from other machines by simply placing the .json files from the "tasks" folder of those machines into the "tasks" folder of this directory. Similarly, execution instance files can be imported by copying the .json files from the "execution_instances" folder. Note that only files named with a number greater than 0 are supported in both folders.

+ 3 - 1
Releases/EasySpider_windows_amd64/readme.txt

@@ -3,4 +3,6 @@
 The software is totally not trojan/virus! If mistaken by antivirus software such as windows defender as a virus, please recover it, or open "EasySpider.bat" to run our software instead.
 
 
-可以从其他机器导入任务,只需要把其他机器的tasks文件夹里的.json文件放入此目录的tasks文件夹里即可。同理执行号文件可以通过复制execution_instances文件夹中的.json文件来导入。注意,两个文件夹里的.json文件只支持命名为大于0的数字。
+可以从其他机器导入任务,只需要把其他机器的tasks文件夹里的.json文件放入此目录的tasks文件夹里即可。同理执行号文件可以通过复制execution_instances文件夹中的.json文件来导入。注意,两个文件夹里的.json文件只支持命名为大于0的数字。
+
+Tasks can be imported from other machines by simply placing the .json files from the "tasks" folder of those machines into the "tasks" folder of this directory. Similarly, execution instance files can be imported by copying the .json files from the "execution_instances" folder. Note that only files named with a number greater than 0 are supported in both folders.

Some files were not shown because too many files changed in this diff