■
Use link inside the Loop
Element is inside iframe
Use element located by xpath relative to the loop
Click here to expand/collapse advanced operations
Clear other field existing values before extracting
This operation will generate a new row of data ☺
Field Name | Example Value | Operations |
---|
{{paras.parameters[i-1]["exampleValues"][0]["value"]}} | Modify Delete Up Down |
Current parameter name (Clicking on the "Modify" option of the field toggles the parameters)
Use relative XPath
Element is inside iframe
XPATH (Field["FieldName"] and eval("your code") can be used in any XPATHS): ☺
Click here to expand/collapse advanced operations
Element is inside iframe
Use text from the loop (If unchecked, the text entered each time will be the text from the "Input Value" text box below. If checked, it will use the text set within the loop.)
Click here to expand/collapse advanced operations
Action is inside iframe
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. Be aware that statements containing exec and eval operations and XPath cannot be tested on the current page, and can only be run when they are actually called upon in a task. 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` 3. Manipulate the above-defined global variable: `self.myVar = self.myVar + 1` 4. Print the above-defined global variable: `print(self.myVar)` 5. Assign the value of a custom variable to the value extracted from a field: `self.myVar = self.outputParameters["Field Name"]` If you want to record your custom variable as a field, please select the next option, "Get value of a Python expression (the "eval" operation)" 6. If you want to import and use a third-party library that the program itself does not carry, you need to first use tools such as pip to install this library locally, and then add the path of the installed library before import, like: (1) In the system command line execute the following command to install the library: pip install emotlib (2) Write the following code in the code box: sys.path.append("D:/Python38/Lib/site-packages") # Assume emotlib library exists in this path 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). 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` 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 Please note that this feature does not support assigning values to variables. In other words, you cannot write something like `self.myVar = 1`. If you want to perform assignment operations, please select the previous option, "Run Python code on current environment (the "exec" operation)"
Whether to record the output/return value of the execution as a field:
Element is inside iframe
Use index value from within the loop (if unchecked, the setting will be the value of the "Set Value" text box below. If checked, it will use the index value set within the loop's dropdown box.)
Option switch Mode
Set value (not applicable for "Switch to the next option" mode)
Element is inside iframe
Use element located by xpath relative to the loop
Operation is in iframe
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` 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.
Operation is in iframe
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` 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 operations within this branch will be executed; otherwise, they will be skipped.