Script
This chapter introduces the basic use of scripts. The script is defined in JSON format and can be easily deserialized in various languages.
Conversion method
Execute Script
Scripts can map all action methods
Introduction to Script initialization parameters
script
dict | str | list
Pre-written scripts
global_script
dict | str | list = None
Global execution script, which will be executed before each execution of any action method. For example, some websites may randomly pop up advertisements, affecting the execution of the following script. Defining this script can determine whether there are advertisements before executing the action method, and if so, perform a series of operations to close the advertisements.
interval
float = 0.5
The interval between every two execution of the action method
wait
float = 10
If the action method contains xpath or CSS parameters, it will automatically implicitly wait for wait seconds until the corresponding element appears in the dom structure.
is_need_syntax_check
bool = True
Do you need to perform strict script syntax checks before execution? If closed, it will increase the probability of errors during execution.
Introduction to Script Executor Parameters
Writing scripts through list step method
Writing scripts using dictionary types may result in nested dictionaries being too deep and difficult to maintain in situations with multiple actions. Writing scripts using a list approach can turn nested processes into serial processes.
Last updated