0

Im somewhat a beginner with Python and recently stumbled across the Selenium module, would appreciate it if someone could help me?

I cant seem to get the selenium module working at all with python3. I have downloaded the geckodriver for firefox but still no luck, or am installing it incorrectly maybe?

Im using this code:

from selenium import webdriver

browser = webdriver.Firefox()

And seem to be receiving this error:

'OSError: [Errno 8] Exec format error'

A copy of the whole error message is pasted below.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    File "/home/chron/.local/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 140, in __init__
        self.service.start()
      File "/home/chron/.local/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 74, in start
          stdout=self.log_file, stderr=self.log_file)
            File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
            restore_signals, start_new_session)
              File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
                  raise child_exception_type(errno_num, err_msg)
              OSError: [Errno 8] Exec format error
3
  • Is the geckodriver in your $PATH? I just set up a linux/python3 selenium app and have never seen this error. Commented Jan 26, 2017 at 18:04
  • how are you invoking your script from the command line? Commented Jan 26, 2017 at 18:05
  • @JaredSmith, a missing geckodriver would give a different error Commented Jan 26, 2017 at 18:06

1 Answer 1

1

OSError: [Errno 8] Exec format error

this looks like it is failing to start geckodriver because you are using a binary that is compiled for the wrong architecture. Make sure you download the correct version for your architecture from https://github.com/mozilla/geckodriver/releases

for example, if you are running 64-bit linux (amd64), you need to download the geckodriver tarball that ends with "linux64.tar.gz".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.