'JavascriptError: SyntaxError: expected expression, got ':' when use driver.executeScript(':screenshot') Selenium
I try to send a command to the console and get a screenshot of one of the DOM tags but when I try to send it I get this error
\`\~\\Desktop\\selenium\\node_modules\\selenium-webdriver\\lib\\error.js:522
let err = new ctor(data.message)
^
JavascriptError: SyntaxError: expected expression, got ':'
at Object.throwDecodedError (\~\\Desktop\\selenium\\node_modules\\selenium-webdriver\\lib\\error.js:522:15)
at parseHttpResponse (\~\\Desktop\\selenium\\node_modules\\selenium-webdriver\\lib\\http.js:548:13)
at Executor.execute (\~\\Desktop\\selenium\\node_modules\\selenium-webdriver\\lib\\http.js:474:28)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Driver.execute (\~\\Desktop\\selenium\\node_modules\\selenium-webdriver\\lib\\webdriver.js:735:17) {
remoteStacktrace: ''
}\`
I need to get a screenshot node with selenium js firefox, it's the only way I could find and the most promising
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
