MCPcopy Create free account
hub / github.com/a943512/PyAibote / execute_script

Method execute_script

PyAibote/WebBotModel/JSinjection.py:10–28  ·  view source on GitHub ↗

注入执行 JS Injection execution JS script: 要执行的 JS 代码 return: 假如注入代码有返回值,则返回此值,否则返回 None script: JS code to be executed return: If the injection code has a return value, this value is returned, otherwise None is returned

(self, script: str)

Source from the content-addressed store, hash-verified

8 """
9
10 def execute_script(self, script: str) -> str:
11 """
12 注入执行 JS
13 Injection execution JS
14
15 script: 要执行的 JS 代码
16 return: 假如注入代码有返回值,则返回此值,否则返回 None
17
18 script: JS code to be executed
19 return: If the injection code has a return value, this value is returned, otherwise None is returned
20
21 示例:
22 Examples:
23 result = execute_script('(()=>alert(123))()')
24 """
25 response = self.SendData("executeScript", script)
26 if response == "null":
27 return None
28 return response
29
30
31

Callers 1

get_element_valueMethod · 0.80

Calls 1

SendDataMethod · 0.80

Tested by

no test coverage detected