python - OSError: [Errno 8] Exec format error selenium -


trying learn how use selenium, managed overcome first error involved chrome driver not being in path name has thrown error.

  selenium import webdriver     selenium.webdriver.common.keys import keys       driver = webdriver.chrome('/users/williamneal/scratch/titanic/chromedriver')     driver.get("http://www.bbc.com") 

the error: traceback (most recent call last):

  file "<ipython-input-1-84256e62b8db>", line 5, in <module>     driver = webdriver.chrome('/users/williamneal/scratch/titanic/chromedriver')    file "/users/williamneal/anaconda/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 62, in __init__     self.service.start()    file "/users/williamneal/anaconda/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 64, in start     stdout=self.log_file, stderr=self.log_file)    file "/users/williamneal/anaconda/lib/python3.5/subprocess.py", line 950, in __init__     restore_signals, start_new_session)    file "/users/williamneal/anaconda/lib/python3.5/subprocess.py", line 1544, in _execute_child     raise child_exception_type(errno_num, err_msg)  oserror: [errno 8] exec format error 

there potential solution here, involves installing chrome drivers via home brew option not available me.

any ideas?

looks complaining format of chromedriver binary. might because of platform , chromedriver format mismatch. example windows requires chromedriver.exe while there different formats linux , mac.

if don't want install through package manager, download chromedriver https://sites.google.com/a/chromium.org/chromedriver/downloads

note : choose file per os

then place anywhere on os , pass path argument. can set webdriver.chrome.driver environment variable if don't want pass location every time.


Comments