I am unable to start Chromedriver
with Selenium
.
from selenium import webdriver
browser = webdriver.Chrome()
browser.get('http://www.google.com')
It never gets to browser.get('http://www.google.com')
but fails with:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.21.371461 (633e689b520b25f3e264a2ede6b74ccc23cb636a),platform=Linux 3.13.0-76-generic x86_64)
I am on Ubuntu 14.04
(64b) using Python 2.7.6
(virtualenv installation) and selenium==2.50.1
.
dm@Z580:~$ which chromedriver
/usr/local/bin/chromedriver
dm@Z580:~$ ll /usr/local/bin/chromedriver
lrwxrwxrwx 1 root root 24 feb 4 22:13 /usr/local/bin/chromedriver -> /opt/google/chromedriver*
EDIT
dm@Z580:~$ google-chrome --version
Google Chrome 48.0.2564.97
Downgraded to Chromedriver 2.20
:
wget http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod 777 chromedriver
sudo mv -f chromedriver /opt/google/chromedriver
but, sadly, still the same result.
Any idea why is this happening?
I don't know if this is the only issue you're having but chromedriver doesn't like "www.google.com", however it is fine with "http://www.google.com"
Ok, so the solution is a bit weird.
I moved the
Chromedriver
binary from/opt/google/
(whereGoogle Chrome
is installed itself) to/opt/
, updated the symlink and it's working now!Compared to the question itself, these two lines of code solve the issue:
And now I am able to run the following Python code:
Chrome starts and everything.
The following line on the old Selenium docs page inspired me to check and eventually to change the
Chromedriver
location: