Skip to content

Commit e8d3fa0

Browse files
committed
refactor: simplify command creation by using RuntimeCommands.evaluate_script
1 parent c5fa956 commit e8d3fa0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pydoll/browser/page.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,7 @@ async def execute_script(self, script: str, element: WebElement = None):
345345
object_id, script, return_by_value=True
346346
)
347347
else:
348-
command = {
349-
'method': 'Runtime.evaluate',
350-
'params': {'expression': script, 'returnByValue': True},
351-
}
348+
command = RuntimeCommands.evaluate_script(script)
352349
return await self._execute_command(command)
353350

354351
async def _wait_page_load(self, timeout: int = 300):

0 commit comments

Comments
 (0)