This commit is contained in:
naibo 2024-08-21 11:57:08 +08:00
parent df62f710e3
commit e74915d94c
2 changed files with 3 additions and 3 deletions

View File

@ -580,7 +580,7 @@ Please note that this feature does not support assigning values to variables. In
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`
3. Return the result of a conditional statement: `self.myVar == 1`
3. Return the result of a conditional statement: `self.myVar > 1`
4. Determining whether the value extracted from a certain field is equal to the value of a certain variable: self.outputParameters["field name"] == self.myVar
If the expression returns a value greater than 0 or evaluates to True, the loop continues; otherwise, it stops.
</pre>

View File

@ -579,8 +579,8 @@ print(emotlib.emoji()) # 使用其中的函数。
<pre class="form-control" style="background: white; margin-top: 20px; min-height: 220px; font-size: 15px!important; word-wrap: break-word; white-space: pre-wrap; border-radius: 0; border: 1px solid" disabled v-if='parseInt(loopType) == 7'>请先阅读此说明再在上方输入框不是本框写具体代码如果要执行大量代码可以直接写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,如果
3. 返回条件判断的值self.myVar == 1
2. 返回自定义全局变量的值self.myVar
3. 返回条件判断的值self.myVar > 1
4. 判断某个字段提取的值是否等于某个变量的值self.outputParameters["字段名"] == self.myVar
以上表达式返回值大于0或为真则继续循环否则停止循环。
</pre>