首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >SessionNotCreatedException:消息:无法创建新服务:使用Selenium 3.14.0和Python3.7.3的ChromeDriverService

SessionNotCreatedException:消息:无法创建新服务:使用Selenium 3.14.0和Python3.7.3的ChromeDriverService
EN

Stack Overflow用户
提问于 2019-08-12 12:49:15
回答 1查看 502关注 0票数 1

Python 3.7.3

Pycharm 2019.1.3

硒单独3.14.0

硒3.141.0

Java JDK 12.0.2

Windows 7

当我试图使用远程webdriver运行脚本时,我的java.version与我所期望的不一样(预期版本至少为12):

代码语言:javascript
复制
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to create new service: ChromeDriverService
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
System info: host: 'host_name', ip: 'localhost', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_221'
Driver info: driver.version: unknown
Stacktrace:
    at org.openqa.selenium.remote.server.ServicedSession$Factory.lambda$get$0 (ServicedSession.java:134)
    at org.openqa.selenium.remote.server.ServicedSession$Factory.apply (ServicedSession.java:151)
    at org.openqa.selenium.remote.server.ActiveSessionFactory.lambda$apply$12 (ActiveSessionFactory.java:177)
    at java.util.stream.ReferencePipeline$3$1.accept (None:-1)
    at java.util.stream.ReferencePipeline$11$1.accept (None:-1)
    at java.util.stream.ReferencePipeline$2$1.accept (None:-1)
    at java.util.Spliterators$ArraySpliterator.tryAdvance (None:-1)
    at java.util.stream.ReferencePipeline.forEachWithCancel (None:-1)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (None:-1)
    at java.util.stream.AbstractPipeline.copyInto (None:-1)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (None:-1)
    at java.util.stream.FindOps$FindOp.evaluateSequential (None:-1)
    at java.util.stream.AbstractPipeline.evaluate (None:-1)
    at java.util.stream.ReferencePipeline.findFirst (None:-1)
    at org.openqa.selenium.remote.server.ActiveSessionFactory.apply (ActiveSessionFactory.java:180)
    at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$null$2 (NewSessionPipeline.java:65)
    at java.util.stream.ReferencePipeline$3$1.accept (None:-1)
    at java.util.stream.ReferencePipeline$2$1.accept (None:-1)
    at java.util.Collections$2.tryAdvance (None:-1)
    at java.util.stream.ReferencePipeline.forEachWithCancel (None:-1)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (None:-1)
    at java.util.stream.AbstractPipeline.copyInto (None:-1)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (None:-1)
    at java.util.stream.FindOps$FindOp.evaluateSequential (None:-1)
    at java.util.stream.AbstractPipeline.evaluate (None:-1)
    at java.util.stream.ReferencePipeline.findFirst (None:-1)
    at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$3 (NewSessionPipeline.java:68)
    at java.util.stream.ReferencePipeline$3$1.accept (None:-1)
    at java.util.stream.ReferencePipeline$3$1.accept (None:-1)
    at java.util.stream.ReferencePipeline$3$1.accept (None:-1)
    at java.util.stream.DistinctOps$1$2.accept (None:-1)
    at java.util.stream.ReferencePipeline$2$1.accept (None:-1)
    at java.util.stream.ReferencePipeline$3$1.accept (None:-1)
    at java.util.stream.ReferencePipeline$2$1.accept (None:-1)
    at java.util.stream.Streams$StreamBuilderImpl.tryAdvance (None:-1)
    at java.util.stream.Streams$ConcatSpliterator.tryAdvance (None:-1)
    at java.util.stream.ReferencePipeline.forEachWithCancel (None:-1)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (None:-1)
    at java.util.stream.AbstractPipeline.copyInto (None:-1)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (None:-1)
    at java.util.stream.FindOps$FindOp.evaluateSequential (None:-1)
    at java.util.stream.AbstractPipeline.evaluate (None:-1)
    at java.util.stream.ReferencePipeline.findFirst (None:-1)
    at org.openqa.selenium.remote.server.NewSessionPipeline.createNewSession (NewSessionPipeline.java:71)
    at org.openqa.selenium.remote.server.commandhandler.BeginSession.execute (BeginSession.java:65)
    at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$3 (WebDriverServlet.java:250)
    at java.util.concurrent.Executors$RunnableAdapter.call (None:-1)
    at java.util.concurrent.FutureTask.run (None:-1)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (None:-1)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (None:-1)
    at java.lang.Thread.run (None:-1)

我尝试过重新安装java,但是版本保持不变- 1.8.0_221。

我在python中的代码:

代码语言:javascript
复制
driver = webdriver.Remote(
   command_executor='http://10.20.10.193:4444/wd/hub',
   desired_capabilities=DesiredCapabilities.CHROME)

driver.get('https://google.com')

设置selenium服务器:

代码语言:javascript
复制
java -jar selenium-server-standalone-3.14.0.jar

我做错什么了?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-08-12 15:33:31

这个错误信息..。

代码语言:javascript
复制
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to create new service: ChromeDriverService
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
System info: host: 'host_name', ip: 'localhost', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_221'
Driver info: driver.version: unknown

...implies表示ChromeDriver没有被识别。

您的主要问题是您正在使用的二进制文件的版本之间的incompatibility,如下所示:

硒客户端驱动程序页面提到:

因此,可能 3.7.3仍然不受支持,您可能不得不将降级为相关版本。

欧特罗

无法使用Selenium和Java11导入org.openqa.selenium.WebDriver

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57461544

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档