5

I'm trying to set up a chrome session with Selenium in my python (2.7) script like this:

from selenium import webdriver
driver=webdriver.Chrome()

But I get the following error:

Traceback (most recent call last):
File "soup_test.py", line 30, in <module>
driver=webdriver.Chrome()
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 61, in __init__
self.service.start()
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 62, in start
stdout=self.log_file, stderr=self.log_file)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error

Searching through other questions a common issue seems to be that chromedriver is not on the path, but I checked and it is. I even tried specifying the path explicitly:

driver=webdriver.Chrome("/path/to/chromedriver")

with the same result. Anyone know what could be the problem? I'd really appreciate the help!

1
  • I'd also like to know..
    – HowApped
    Mar 24, 2016 at 18:24

1 Answer 1

2

I eventually solved the problem by uninstalling all instances of chromedriver (I had multiple in different locations) and then installing it again with homebrew: brew install chromedriver

1
  • On osx once you do brew install chromedriver you should be able to point executable_path='/usr/local/bin/chromedriver
    – Smitty
    Nov 2, 2017 at 1:44

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.