5

I try to find answer and can't, now I ask by myself.

I wrote simple test

from selenium import webdriver

driver = webdriver.Chrome(executable_path=r"/home/tranter/workspace/chromedriver")
driver.get("http://www.python.org")
driver.close()

than I have traceback

> tranter@tranter-VirtualBox:~/workspace$ python testchrome.py Traceback
> (most recent call last): File "testchrome.py", line 6, in <module>
> driver =
> webdriver.Chrome(executable_path=r"/home/tranter/workspace/chromedriver")
> File
> "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py",
> line 65, in __init__ keep_alive=True) File
> "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
> line 73, in __init__ self.start_session(desired_capabilities,
> browser_profile) File
> "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
> line 121, in start_session 'desiredCapabilities':
> desired_capabilities, File
> "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
> line 173, in execute self.error_handler.check_response(response) File
> "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py",
> line 166, in check_response raise exception_class(message, screen,
> stacktrace) selenium.common.exceptions.WebDriverException: Message:
> u'unknown error: Chrome failed to start: exited abnormally\n (Driver
> info: chromedriver=2.10.267517,platform=Linux 3.13.0-35-generic x86)'

I have latest version of chromedriver 10, latest chromium, latest selenium webdriver. And it all I start in xubuntu

Linux version 3.13.0-35-generic (buildd@roseapple) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #62-Ubuntu SMP Fri Aug 15 01:58:01 UTC 2014

Please help me :(

Mosam Mehta
  • 1,658
  • 6
  • 25
  • 34
tranter
  • 51
  • 1
  • 1
  • 3

2 Answers2

15

For Linux user:

Start the Display before start the Chrome. for more info click here

from selenium import webdriver
from pyvirtualdisplay import Display
# Add following 2 line before start the Chrome
display = Display(visible=0, size=(800, 800))  
display.start()
driver = webdriver.Chrome()
driver.get("http://www.google.com")
driver.quit()
display.stop()
Perfect
  • 1,616
  • 1
  • 19
  • 27
Vicky
  • 5,098
  • 2
  • 33
  • 31
0

2.10.267517 is not the latest version.

$ chromedriver --version
ChromeDriver 2.10.267518

With above version, Python 2.7.6, your code work well. (except that I modified the chromedriver path)

FYI, here are uname for my ubuntu:

$ uname -a
Linux jmlee12 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ python -V
Python 2.7.6
falsetru
  • 357,413
  • 63
  • 732
  • 636
  • @tranter, Here: http://chromedriver.storage.googleapis.com/index.html You can find the current lastest version here: http://chromedriver.storage.googleapis.com/index.html?path=2.10/ – falsetru Sep 23 '14 at 11:09
  • I try here, but 10 verion is 17, not 18. And it is 32bit version, can you share me this thing somehow? – tranter Sep 23 '14 at 12:51
  • @tranter, If you follow the link, you can find both 32bit, 64bit version. FYI, here's the link to the 64bit version (2.10.267518) http://chromedriver.storage.googleapis.com/2.10/chromedriver_linux64.zip – falsetru Sep 23 '14 at 13:26
  • I don't understand why when I download the chromedriver_linux32.zip 2014-05-01 20:46:22 2.33MB 4fecc99b066cb1a346035bf022607104 it's gonna be 17 version :( – tranter Sep 23 '14 at 13:41
  • @tranter, Do you mean your system is 32bit? – falsetru Sep 23 '14 at 13:44