瀏覽代碼

提取数据操作获得eval返回值

naibo 2 年之前
父節點
當前提交
1705418c87

文件差異過大導致無法顯示
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/execution_instances/10.json


文件差異過大導致無法顯示
+ 0 - 0
.temp_to_pub/EasySpider_windows_x64/tasks/128.json


+ 3 - 2
ElectronJS/src/taskGrid/FlowChart.html

@@ -271,11 +271,12 @@
                             <option :value = 8>OCR Results</option>
                             <option :value = 9>Return value of JavaScript code (for this element), starting with 'return')</option>
                             <option :value = 12>System command return value</option>
+                            <option :value = 13>Value of a Python expression (the "eval" operation)</option>
                             <option :value = 10>Selected value of the current select box</option>
                             <option :value = 11>Selected text of the current select box</option>
                         </select>
-                        <div v-if='paras.parameters[paraIndex]["contentType"] == 9'>
-                            <label>JavaScript Code (Use Field["FieldName"] to input the lastest value of a field): </label>
+                        <div v-if='paras.parameters[paraIndex]["contentType"] == 9 || paras.parameters[paraIndex]["contentType"] >= 12'>
+                            <label>Code (Use Field["FieldName"] to input the lastest value of a field): </label>
                             <textarea onkeydown="inputDelete(event)" class="form-control" rows="2"
                                       placeholder='The element should be represented by arguments[0]. Here is an example: return arguments[0].innerText + "US Dollar". This code extracts the innerText of the element and appends "US Dollar"  to it.' v-model='paras.parameters[paraIndex]["JS"]'></textarea>
                             <label>Maximum wait time for script execution (0 represents unlimited wait time): </label>

+ 3 - 2
ElectronJS/src/taskGrid/FlowChart_CN.html

@@ -271,11 +271,12 @@
                             <option :value = 8>OCR识别文字</option>
                             <option :value = 9>(针对该元素的)JavaScript代码返回值(需以return 开头)</option>
                             <option :value = 12>系统命令返回值</option>
+                            <option :value = 13>执行环境下的Python表达式值(eval操作)</option>
                             <option :value = 10>当前选择框选中的选项值</option>
                             <option :value = 11>当前选择框选中的选项文本</option>
                         </select>
-                        <div v-if='paras.parameters[paraIndex]["contentType"] == 9 || paras.parameters[paraIndex]["contentType"] == 12'>
-                            <label>JavaScript代码(也可以不针对该元素,直接写return JS代码即可)/系统命令代码:</label>
+                        <div v-if='paras.parameters[paraIndex]["contentType"] == 9 || paras.parameters[paraIndex]["contentType"] >= 12'>
+                            <label>JavaScript(也可以不针对该元素,直接写return JS代码即可)/系统命令/Python代码:</label>
                             <textarea onkeydown="inputDelete(event)" class="form-control" rows="2"
                                       placeholder='如要针对该元素,则该元素用arguments[0]来表示,示例:return arguments[0].innerText + "美元",即实现了提取该元素innerText并后面加“美元”的功能;不然直接如写return new Date().toString()即可获得当前时间戳。' v-model='paras.parameters[paraIndex]["JS"]'></textarea>
                             <label>最长等待脚本执行时间(0代表无限等待): </label>

文件差異過大導致無法顯示
+ 0 - 0
ElectronJS/tasks/182.json


+ 1 - 1
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", "[9]", "--headless", "0", "--user_data", "1", "--keyboard", "0"]
+            "args": ["--id", "[84]", "--headless", "0", "--user_data", "1", "--keyboard", "0"]
         }
     ]
 }

+ 2 - 0
ExecuteStage/easyspider_executestage.py

@@ -1415,6 +1415,8 @@ class BrowserThread(Thread):
                 2, p["JS"], p["JSWaitTime"], element, iframe=p["iframe"])
         elif p["contentType"] == 12: # 系统命令返回值
             content = self.execute_code(1, p["JS"], p["JSWaitTime"])
+        elif p["contentType"] == 13: # eval返回值
+            content = self.execute_code(6, p["JS"], p["JSWaitTime"])
         elif p["contentType"] == 10:  # 下拉框选中的值
             try:
                 select_element = Select(element)

部分文件因文件數量過多而無法顯示