diff --git a/ElectronJS/.gitignore b/ElectronJS/.gitignore index 70c4f97..2ad8bfa 100644 --- a/ElectronJS/.gitignore +++ b/ElectronJS/.gitignore @@ -18,3 +18,4 @@ npminstall-debug.log mysql_config.json EasySpider_en/ EasySpider_zh/ +TempUserDataFolder/ diff --git a/ElectronJS/clean_and_release_win32.cmd b/ElectronJS/clean_and_release_win32.cmd index 5c5c260..94bf338 100644 --- a/ElectronJS/clean_and_release_win32.cmd +++ b/ElectronJS/clean_and_release_win32.cmd @@ -16,6 +16,7 @@ copy ..\ExecuteStage\myChrome.py ..\.temp_to_pub\EasySpider_windows_x32\Code copy ..\ExecuteStage\utils.py ..\.temp_to_pub\EasySpider_windows_x32\Code copy ..\ExecuteStage\requirements.txt ..\.temp_to_pub\EasySpider_windows_x32\Code copy ..\ExecuteStage\Readme.md ..\.temp_to_pub\EasySpider_windows_x32\Code +copy ..\ExecuteStage\myCode.py ..\.temp_to_pub\EasySpider_windows_x32 xcopy ..\ExecuteStage\undetected_chromedriver_ES ..\.temp_to_pub\EasySpider_windows_x32\Code\undetected_chromedriver_ES /E /I /Y xcopy ..\ExecuteStage\.vscode ..\.temp_to_pub\EasySpider_windows_x32\Code\.vscode /E /I /Y rmdir /s /q ..\.temp_to_pub\EasySpider_windows_x32\user_data diff --git a/ElectronJS/clean_and_release_win64.cmd b/ElectronJS/clean_and_release_win64.cmd index 2fd399a..c736246 100644 --- a/ElectronJS/clean_and_release_win64.cmd +++ b/ElectronJS/clean_and_release_win64.cmd @@ -16,6 +16,7 @@ copy ..\ExecuteStage\myChrome.py ..\.temp_to_pub\EasySpider_windows_x64\Code copy ..\ExecuteStage\utils.py ..\.temp_to_pub\EasySpider_windows_x64\Code copy ..\ExecuteStage\requirements.txt ..\.temp_to_pub\EasySpider_windows_x64\Code copy ..\ExecuteStage\Readme.md ..\.temp_to_pub\EasySpider_windows_x64\Code +copy ..\ExecuteStage\myCode.py ..\.temp_to_pub\EasySpider_windows_x64 xcopy ..\ExecuteStage\undetected_chromedriver_ES ..\.temp_to_pub\EasySpider_windows_x64\Code\undetected_chromedriver_ES /E /I /Y xcopy ..\ExecuteStage\.vscode ..\.temp_to_pub\EasySpider_windows_x64\Code\.vscode /E /I /Y rmdir /s /q ..\.temp_to_pub\EasySpider_windows_x64\user_data diff --git a/ElectronJS/main.js b/ElectronJS/main.js index 04872bb..16a4f14 100644 --- a/ElectronJS/main.js +++ b/ElectronJS/main.js @@ -322,10 +322,10 @@ async function beginInvoke(msg, ws) { let parameters = []; console.log(msg.message) if (msg.message.user_data_folder == null || msg.message.user_data_folder == undefined || msg.message.user_data_folder == "") { - parameters = ["--id", "[" + msg.message.id + "]", "--server_address", server_address, "--user_data", 0]; + parameters = ["--ids", "[" + msg.message.id + "]", "--server_address", server_address, "--user_data", 0]; } else { let user_data_folder_path = path.join(task_server.getDir(), msg.message.user_data_folder); - parameters = ["--id", "[" + msg.message.id + "]", "--server_address", server_address, "--user_data", 1]; + parameters = ["--ids", "[" + msg.message.id + "]", "--server_address", server_address, "--user_data", 1]; config.user_data_folder = msg.message.user_data_folder; config.absolute_user_data_folder = user_data_folder_path; fs.writeFileSync(path.join(task_server.getDir(), "config.json"), JSON.stringify(config)); diff --git a/ElectronJS/package-lock.json b/ElectronJS/package-lock.json index 1703d80..e3cc5cb 100644 --- a/ElectronJS/package-lock.json +++ b/ElectronJS/package-lock.json @@ -16,7 +16,7 @@ "http": "^0.0.1-security", "multer": "^1.4.5-lts.1", "node-window-manager": "^2.2.4", - "selenium-webdriver": "^4.8.0", + "selenium-webdriver": "^4.16.0", "ws": "^8.12.0", "xlsx": "^0.18.5" }, @@ -4800,12 +4800,13 @@ "license": "MIT" }, "node_modules/selenium-webdriver": { - "version": "4.10.0", - "license": "Apache-2.0", + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.16.0.tgz", + "integrity": "sha512-IbqpRpfGE7JDGgXHJeWuCqT/tUqnLvZ14csSwt+S8o4nJo3RtQoE9VR4jB47tP/A8ArkYsh/THuMY6kyRP6kuA==", "dependencies": { "jszip": "^3.10.1", "tmp": "^0.2.1", - "ws": ">=8.13.0" + "ws": ">=8.14.2" }, "engines": { "node": ">= 14.20.0" @@ -5600,8 +5601,9 @@ "license": "ISC" }, "node_modules/ws": { - "version": "8.13.0", - "license": "MIT", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", + "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", "engines": { "node": ">=10.0.0" }, diff --git a/ElectronJS/package.json b/ElectronJS/package.json index 93946e6..51748f6 100644 --- a/ElectronJS/package.json +++ b/ElectronJS/package.json @@ -38,7 +38,7 @@ "http": "^0.0.1-security", "multer": "^1.4.5-lts.1", "node-window-manager": "^2.2.4", - "selenium-webdriver": "^4.8.0", + "selenium-webdriver": "^4.16.0", "ws": "^8.12.0", "xlsx": "^0.18.5" }, diff --git a/ElectronJS/package_linux64.sh b/ElectronJS/package_linux64.sh index d42d9e7..78def47 100755 --- a/ElectronJS/package_linux64.sh +++ b/ElectronJS/package_linux64.sh @@ -24,6 +24,7 @@ cp ../ExecuteStage/myChrome.py ../.temp_to_pub/EasySpider_Linux_x64/Code cp ../ExecuteStage/utils.py ../.temp_to_pub/EasySpider_Linux_x64/Code cp ../ExecuteStage/requirements.txt ../.temp_to_pub/EasySpider_Linux_x64/Code cp ../ExecuteStage/Readme.md ../.temp_to_pub/EasySpider_Linux_x64/Code +cp ../ExecuteStage/myCode.py ../.temp_to_pub/EasySpider_Linux_x64 cp -Rf ../ExecuteStage/undetected_chromedriver_ES ../.temp_to_pub/EasySpider_Linux_x64/Code cp -Rf ../ExecuteStage/.vscode ../.temp_to_pub/EasySpider_Linux_x64/Code chmod 777 ../.temp_to_pub/EasySpider_Linux_x64/easy-spider.sh diff --git a/ElectronJS/package_macos.sh b/ElectronJS/package_macos.sh index 518274c..1e94815 100755 --- a/ElectronJS/package_macos.sh +++ b/ElectronJS/package_macos.sh @@ -24,5 +24,6 @@ cp ../ExecuteStage/myChrome.py ../.temp_to_pub/EasySpider_MacOS_all_arch/Code cp ../ExecuteStage/utils.py ../.temp_to_pub/EasySpider_MacOS_all_arch/Code cp ../ExecuteStage/requirements.txt ../.temp_to_pub/EasySpider_MacOS_all_arch/Code cp ../ExecuteStage/Readme.md ../.temp_to_pub/EasySpider_MacOS_all_arch/Code +cp ../ExecuteStage/myCode.py ../.temp_to_pub/EasySpider_MacOS_all_arch cp -Rf ../ExecuteStage/undetected_chromedriver_ES ../.temp_to_pub/EasySpider_MacOS_all_arch/Code cp -Rf ../ExecuteStage/.vscode ../.temp_to_pub/EasySpider_MacOS_all_arch/Code diff --git a/ElectronJS/src/index.html b/ElectronJS/src/index.html index ae799f5..3bca426 100644 --- a/ElectronJS/src/index.html +++ b/ElectronJS/src/index.html @@ -1,5 +1,5 @@ - - + + diff --git a/ElectronJS/src/taskGrid/FlowChart.html b/ElectronJS/src/taskGrid/FlowChart.html index 36f20e8..27f9d08 100644 --- a/ElectronJS/src/taskGrid/FlowChart.html +++ b/ElectronJS/src/taskGrid/FlowChart.html @@ -91,6 +91,7 @@
+
@@ -230,7 +231,7 @@

Use relative XPath

Element is inside iframe

-

XPATH (Field["FieldName"] can be used in any XPATHS):

+

XPATH (Field["FieldName"] and eval("your code") can be used in any XPATHS):

@@ -389,7 +390,7 @@

-
Please read the instructions first and then write the specific code in the input box above (not in this box).
+                        
Please read the instructions first and then write the specific code in the input box above (not in this box). To execute a large amount of code, you can simply write "outside:myCode.py" and the program will read and execute the code within myCode.py under the EasySpider directory.
 This option is an advanced feature that allows direct manipulation of the running browser using Python code. You can also customize variables in the entire execution environment and perform operations such as modifying and assigning values. Here are some examples:
 1. Use `self.browser` to refer to the current browser being operated. You can directly use Selenium's API to perform operations, such as `self.browser.find_element(By.CSS_SELECTOR, "body").send_keys(Keys.END)` to scroll to the bottom.
 2. Define a global variable: `self.myVar = 1`
@@ -407,7 +408,7 @@ sys.path.append("D:/Python38/Lib/site-packages") # Assume emotlib library exists
 import emotlib # Now you can use emotlib library
 print(emotlib.emoji()) # Use one of its functions.
 
-
Please read the instructions first and then write the specific code in the input box above (not in this box).
+                        
Please read the instructions first and then write the specific code in the input box above (not in this box). To execute a large amount of code, you can simply write "outside:myCode.py" and the program will read and execute the code within myCode.py under the EasySpider directory.
 This option is an advanced feature that allows directly returning the expression value of Python code, and in other places, use Field["FieldName"] to represent the return value of this operation.. Here are some examples:
 1. Return relevant values of the current browser object. Use `self.browser` to refer to the current browser being operated. You can directly use Selenium's API to perform operations, such as `self.browser.find_element(By.CSS_SELECTOR, "body").text` to return the text on the current page.
 2. Return the value of a custom global variable: `self.myVar`
@@ -529,7 +530,7 @@ Please note that this feature does not support assigning values to variables. In
                     
-
Please read the instructions first and then write the specific code in the input box above (not in this box).
+                        
Please read the instructions first and then write the specific code in the input box above (not in this box). To execute a large amount of code, you can simply write "outside:myCode.py" and the program will read and execute the code within myCode.py under the EasySpider directory.
 Loop based on the expression value of Python code. Here are some examples:
 1. Return relevant values of the current browser object. Use `self.browser` to refer to the current browser being operated. You can directly use Selenium's API to perform operations, such as `self.browser.find_element(By.CSS_SELECTOR, "body").text=="123"`, which checks whether the current page contains the text "123".
 2. Return the value of a custom global variable: `self.myVar`
@@ -541,8 +542,12 @@ If the expression returns a value greater than 0 or evaluates to True, the loop
                         
                     
- - +
+ + + + +
@@ -602,7 +607,7 @@ If the expression returns a value greater than 0 or evaluates to True, the loop
-
Please read the instructions first and then write the specific code in the input box above (not in this box).
+                        
Please read the instructions first and then write the specific code in the input box above (not in this box). To execute a large amount of code, you can simply write "outside:myCode.py" and the program will read and execute the code within myCode.py under the EasySpider directory. 
 Use the expression value of Python code to determine whether a condition is satisfied. Here are some examples:
 1. Return relevant values of the current browser object. Use `self.browser` to refer to the current browser being operated. You can directly use Selenium's API to perform operations, such as `self.browser.find_element(By.CSS_SELECTOR, "body").text=="123"`, which checks whether the current page contains the text "123".
 2. Return the value of a custom global variable: `self.myVar`
@@ -680,7 +685,7 @@ If the expression returns a value greater than 0 or evaluates to True, the opera
                     
                     
                     
                     
+
+                    
+                    
+                    
                     
                     
                     
diff --git a/ElectronJS/src/taskGrid/FlowChart_CN.html b/ElectronJS/src/taskGrid/FlowChart_CN.html
index f2e5e76..7a90b7f 100644
--- a/ElectronJS/src/taskGrid/FlowChart_CN.html
+++ b/ElectronJS/src/taskGrid/FlowChart_CN.html
@@ -91,7 +91,8 @@
                 
- + +
@@ -104,7 +105,7 @@ - +
@@ -230,7 +231,7 @@

使用相对循环内的XPATH

元素在iframe内

-

XPath(所有XPath内均写Field["字段名"]表示参数值):

+

XPath(所有XPath内均可用Field["字段名"]表示参数值,用eval("你的代码")来替换成自定义的变量):

@@ -389,7 +390,7 @@

-
请先阅读此说明,再在上方输入框(不是本框)写具体代码。
+                        
请先阅读此说明,再在上方输入框(不是本框)写具体代码,如果要执行大量代码,可以直接写outside:myCode.py,这样程序就会读取并执行EasySpider目录下的myCode.py中的代码。
 此选项为高级功能,可以直接用Python代码操纵正在运行中的浏览器,及可以自定义整个执行环境中的变量,并对变量进行修改赋值等操作,示例:
 1. 用self.browser表示当前操作的浏览器,可直接用selenium的API进行操作,如self.browser.find_element(By.CSS_SELECTOR, "body").send_keys(Keys.END)即可滚动到页面最下方。
 2. 自定义一个全局变量:self.myVar = 1
@@ -407,7 +408,7 @@ sys.path.append("D:/Python38/Lib/site-packages") # 假设此路径下有emotlib
 import emotlib # 此时就可以使用emotlib库了
 print(emotlib.emoji()) # 使用其中的函数。
 
-
请先阅读此说明,再在上方输入框(不是本框)写具体代码。
+                        
请先阅读此说明,再在上方输入框(不是本框)写具体代码,如果要执行大量代码,可以直接写outside:myCode.py,这样程序就会读取并执行EasySpider目录下的myCode.py中的代码。
 此选项为高级功能,可以直接返回Python代码的表达式值,并在其他位置用Field["本操作名称"]表示此操作返回值,示例:
 1. 返回当前浏览器对象的相关值,用self.browser表示当前操作的浏览器,可直接用selenium的API进行操作,如self.browser.find_element(By.CSS_SELECTOR, "body").text即可返回当前页面的文字。
 2. 返回自定义全局变量的值:self.myVar
@@ -529,7 +530,7 @@ print(emotlib.emoji()) # 使用其中的函数。
                     
-
请先阅读此说明,再在上方输入框(不是本框)写具体代码。
+                        
请先阅读此说明,再在上方输入框(不是本框)写具体代码,如果要执行大量代码,可以直接写outside:myCode.py,这样程序就会读取并执行EasySpider目录下的myCode.py中的代码。
 根据Python代码的表达式值来决定是否循环,示例:
 1. 返回当前浏览器对象的相关值,用self.browser表示当前操作的浏览器,可直接用selenium的API进行操作,如self.browser.find_element(By.CSS_SELECTOR, "body").text=="123",表示判断当前页面是否为123这个文本。
 2. 返回自定义全局变量的值:self.myVar,如果
@@ -541,8 +542,12 @@ print(emotlib.emoji()) # 使用其中的函数。
                         
                     
- - +
+ + + + +
@@ -602,7 +607,7 @@ print(emotlib.emoji()) # 使用其中的函数。
-
请先阅读此说明,再在上方输入框(不是本框)写具体代码。
+                        
请先阅读此说明,再在上方输入框(不是本框)写具体代码,如果要执行大量代码,可以直接写outside:myCode.py,这样程序就会读取并执行EasySpider目录下的myCode.py中的代码。
 根据Python代码的表达式值来判断条件是否满足,示例:
 1. 返回当前浏览器对象的相关值,用self.browser表示当前操作的浏览器,可直接用selenium的API进行操作,如self.browser.find_element(By.CSS_SELECTOR, "body").text=="123",表示判断当前页面是否为123这个文本。
 2. 返回自定义全局变量的值:self.myVar,如果
@@ -680,7 +685,7 @@ print(emotlib.emoji()) # 使用其中的函数。
                     
                     
                     
                     
+                    
+                    
                     
                     
                     
diff --git a/ElectronJS/src/taskGrid/invokeTask.html b/ElectronJS/src/taskGrid/invokeTask.html
index 50553e5..ad956b7 100644
--- a/ElectronJS/src/taskGrid/invokeTask.html
+++ b/ElectronJS/src/taskGrid/invokeTask.html
@@ -10,7 +10,7 @@
     
     
     
-    Task Invoke
+    任务调用 | Task Invoke