问题描述
我尝试用 Selenium 启动 Chromedriver
和下面的错误消息:
我正在使用这些:
- CentOS 7.3
- Python(3.6.2)
- 硒 (3.7.0)
- 谷歌浏览器 (62.0.3202.89)
- chromedriver(2.9)/我改成chromedriver=2.33.506092
- Xvfb
ps,我也试过了
driver = webdriver.Chrome('/usr/local/bin/chromedriver')
,不行……
test.py输出
参考:Selenium 无法启动 Chromedriver
- 在我的服务器上在后台启动 Xvfb:
Xvfb :0 -ac -screen 0 1024x768x24 &
也不起作用
ref:未知错误:Chrome 失败启动:异常退出(驱动信息:chromedriver=2.9
从您提到的配置中可以明显看出您使用的是 Selenium v3.7.0
, Google Chrome 62.0
以及不兼容的 chromedriver v2.9
.因此,我们看到了错误 WebDriverException: Message: unknown error: Chrome failed to start: exited异常
ChromeDriver v2.33
的发行说明明确提到Supports Chrome v60-62
解决方案:
从 chromedriver v2.33
="nofollow noreferrer">this link
并执行你的测试用例.
更新:
试试下面的代码块:
<块引用>
或
I try to start Chromedriver with Selenium
and error msg below:
I am using these:
- CentOS 7.3
- Python(3.6.2)
- selenium (3.7.0)
- Google Chrome (62.0.3202.89)
- chromedriver(2.9)/ I changed to chromedriver=2.33.506092
- Xvfb
ps, I also tried
driver = webdriver.Chrome('/usr/local/bin/chromedriver')
,it not work...
test.py output
ref :Selenium fails to start Chromedriver
- On my server start Xvfb in the background:
Xvfb :0 -ac -screen 0 1024x768x24 &
and also not work
ref:unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.9
It is much evident from your mentioned configuration that you are using Selenium v3.7.0
, Google Chrome 62.0
along with chromedriver v2.9
which is not compatible. Hence we are seeing the error WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
The Release Notes of
ChromeDriver v2.33
clearly mentionsSupports Chrome v60-62
Solution:
Download the latest chromedriver v2.33
from this link
and execute your testcase.
Update :
Try the following code block :
OR
这篇关于Selenium 无法在 CentOS 中启动 Chromedriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!