コード例 #1
0
ファイル: _frame.py プロジェクト: tipiqi/playwright-python
 async def evaluate(self,
                    expression: str,
                    arg: Serializable = None,
                    force_expr: bool = None) -> Any:
     if not is_function_body(expression):
         force_expr = True
     return parse_result(await self._channel.send(
         "evaluateExpression",
         dict(
             expression=expression,
             isFunction=not (force_expr),
             arg=serialize_argument(arg),
         ),
     ))
コード例 #2
0
 async def evalOnSelectorAll(
     self,
     selector: str,
     expression: str,
     arg: Serializable = None,
     force_expr: bool = None,
 ) -> Any:
     return parse_result(await self._channel.send(
         "evalOnSelectorAll",
         dict(
             selector=selector,
             expression=expression,
             isFunction=not (force_expr),
             arg=serialize_argument(arg),
         ),
     ))
コード例 #3
0
 async def send(self, method: str, params: Dict = None) -> Dict:
     result = await self._channel.send("send", locals_to_params(locals()))
     return parse_result(result)
コード例 #4
0
 def _on_event(self, params: Any) -> None:
     self.emit(params["method"], parse_result(params["params"]))