MCPcopy Create free account
hub / github.com/WwwwwyDev/crawlipt / __init__

Method __init__

crawlipt/script.py:522–545  ·  view source on GitHub ↗

Script Parser :param script: Need a str of json or dict or list steps that conforms to syntax conventions :param global_script: This script will be executed before every actions :param interval: The direct interval between two consecutive scripts :param wait:

(self, script: dict | str | list, global_script: dict | str | list = None, interval: float = 0.5,
                 wait: float = 10, is_need_syntax_check: bool = True)

Source from the content-addressed store, hash-verified

520
521 @check
522 def __init__(self, script: dict | str | list, global_script: dict | str | list = None, interval: float = 0.5,
523 wait: float = 10, is_need_syntax_check: bool = True):
524 """
525 Script Parser
526 :param script: Need a str of json or dict or list steps that conforms to syntax conventions
527 :param global_script: This script will be executed before every actions
528 :param interval: The direct interval between two consecutive scripts
529 :param wait: The longest wait time before presence of element located
530 :param is_need_syntax_check: Whether the script need a syntax check
531 """
532 self.script = ScriptProcess.generate(script)
533 if global_script is None:
534 self.global_script = {}
535 else:
536 self.global_script = ScriptProcess.generate(global_script)
537 self.is_need_syntax_check = is_need_syntax_check
538 if self.is_need_syntax_check:
539 ScriptProcess.syntax_check(self.script)
540 ScriptProcess.syntax_check(self.global_script)
541 assert interval >= 0
542 assert wait >= 0
543 self.interval = interval
544 self.wait = wait
545 self.return_record = {}
546
547 @check
548 def process(self, webdriver: WebDriver, variable: VariableBase = None, store: StoreBase = None) -> Any:

Callers

nothing calls this directly

Calls 2

generateMethod · 0.80
syntax_checkMethod · 0.80

Tested by

no test coverage detected