【发布时间】:2018-05-18 15:39:22
【问题描述】:
关于使用
WebElement img = driver.findElement(By.id("abc"));
我收到以下错误 -
WebElement img = driver.findElement(webdriver.By.id('captchaimg'));
^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
我已经安装的包 -
硒网络驱动程序
色度驱动
网络驱动程序
版本 -
- 节点 8.11.2
- selenium-webdriver 4.0.0-alpha.1
- chromedriver 2.38(从here下载)
【问题讨论】:
-
显示你的nodejs和selenium-webdriver版本,你需要使用更高的nodejs
-
@yong 我已经添加了所有使用过的软件包的版本,如果你需要其他的东西你可以问
-
我从 Cruisepandey 更新了答案。
标签: javascript node.js selenium selenium-webdriver