You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a known bug that will be fixed in the next release. For now, execute_command can only run the same code you'd be able to execute in the browser console. So, to use return, you'll need to place your code inside a function. I ask for a bit of patience, his will become more intuitive soon
Checklist before reporting
pydoll Version
1.7.0
Python Version
3.12
Operating System
Windows
Bug Description
when i run
() => { const finalBtn = document.querySelector('div.contact-boxes.ng-star-inserted'); if (finalBtn) { return finalBtn.innerHTML; } else { return "Element not found"; } }
i get
{'id': 19, 'result': {'result': {'type': 'object', 'subtype': 'error', 'className': 'SyntaxError', 'description': 'SyntaxError: Illegal return statement', 'objectId': '7549169250272292091.6.2'}, 'exceptionDetails': {'exceptionId': 1, 'text': 'Uncaught', 'lineNumber': 2, 'columnNumber': 36, 'scriptId': '40', 'exception': {'type': 'object', 'subtype': 'error', 'className': 'SyntaxError', 'description': 'SyntaxError: Illegal return statement', 'objectId': '7549169250272292091.6.3'}}}}
Steps to Reproduce
i run
i even tried the one in docs
title = await page.execute_script('return document.title')
Code Example
Expected Behavior
No response
Actual Behavior
No response
Relevant Log Output
Additional Context
No response
The text was updated successfully, but these errors were encountered: