3

I try to start Chromedriver with Selenium

from selenium import webdriver
driver = webdriver.Chrome()
driver.get("http://www.google.com/")
print(driver.title)

and error msg below:

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)

I am using these:

[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)/ I changed to chromedriver=2.33.506092
  • Xvfb

ps, I also tried

  1. driver = webdriver.Chrome('/usr/local/bin/chromedriver'),it not work...

test.py output

ref :Selenium fails to start Chromedriver

  1. 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

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Cokky Wu
  • 31
  • 1
  • 3

1 Answers1

2

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 mentions Supports Chrome v60-62

Solution:

Download the latest chromedriver v2.33 from this link and execute your testcase.

Update :

Try the following code block :

from selenium import webdriver
driver = webdriver.Chrome(executable_path='/usr/local/bin/chromedriver')
driver.get('https://www.google.co.in')
print("Page Title is : %s" %driver.title)
driver.quit()

OR

from selenium import webdriver
driver = webdriver.Chrome(executable_path='/opt/chromedriver')
driver.get('https://www.google.co.in')
print("Page Title is : %s" %driver.title)
driver.quit()
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Thanks. I am new to python. I tried install 2.33 this time, but still not work, 'selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 3.10.0-693.5.2.el7.x86_64 x86_64)' – Cokky Wu Nov 14 '17 at 06:08
  • thanks for help, still failed. I add the screenshot in my question, please check in "test.py"& "output" – Cokky Wu Nov 14 '17 at 06:27
  • I am trying to work this code on a centos server, not local. I am trying use pyvirtualdisplay – Cokky Wu Nov 14 '17 at 06:47
  • This solution does not work for me, please suggest or reopen my question: https://stackoverflow.com/questions/60274116/selenium-webdriver-exception-chrome-failed-to-start-exited-abnormally-on-cent – Grishma Oswal Feb 18 '20 at 07:09