我尝试使用Selenium启动Chromedriver
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("http://www.google.com/")
print(driver.title)
以下是错误信息:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.33.506092,platform=Linux 3.10.0-693.5.2.el7.x86_64 x86_64)
我正在使用以下内容:
[root@jdu4e00u53f7 workspace]# ll /usr/local/bin/chromedriver
lrwxrwxrwx 1 root root 17 11月 14 00:31 /usr/local/bin/chromedriver -> /opt/chromedriver
- CentOS 7.3
- Python(3.6.2)
- selenium (3.7.0)
- Google Chrome (62.0.3202.89)
- chromedriver(2.9)/ 我更换为 chromedriver=2.33.506092
- Xvfb
注:我也尝试过
driver = webdriver.Chrome('/usr/local/bin/chromedriver')
,但不起作用...
参考:Selenium fails to start Chromedriver
- 在我的服务器上后台运行 Xvfb:
Xvfb :0 -ac -screen 0 1024x768x24 &
但也不起作用。
参考:unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.9