首页 新闻 会员 周边 捐助

selenium server 为什么会有geckodriver.exe错误

0
[已关闭问题] 关闭于 2017-08-13 21:19
from selenium.webdriver import Remote
import time
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
driver = Remote(command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities={'platform': 'ANY',
                      'browserName':'firefox',
                      'version': '',
                      'javascriptEnabled': True})
driver.get('http://www.baidu.com')
title=driver.title
print (title)
time.sleep(3)
driver.quit()

我是这样写的

但在selenium server 出现错误:

Driver info: driver.version: unknown
        at java.util.concurrent.FutureTask.report(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSessi
on.java:183)
        at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSessio
n.java:119)
        at org.openqa.selenium.remote.server.DefaultSession.createSession(Defaul
tSession.java:95)
省略部分
Caused by: java.lang.IllegalStateException: The path to the driver executable mu
st be set by the webdriver.gecko.driver system property; for more information, s
ee https://github.com/mozilla/geckodriver. The latest version can be downloaded
from https://github.com/mozilla/geckodriver/releases

编译器里也是同样的错误:

selenium.common.exceptions.WebDriverException: Message: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.co

这是什么原因?

 

geckodriver.exe我也放到firefox目录了

还没有的主页 还没有 | 小虾三级 | 园豆:531
提问于:2017-04-02 18:45
< >
分享
所有回答(2)
0

 这个可执行文件需要加到path中,试试看,之前也遇到过,百度基本都能解决

dearjazz | 园豆:202 (菜鸟二级) | 2017-04-17 16:40

 path加过了,不行

支持(0) 反对(0) 还没有 | 园豆:531 (小虾三级) | 2017-04-18 16:15
0

  [ 自己解决 ]

还没有 | 园豆:531 (小虾三级) | 2017-08-13 21:19
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册