Selenium error on geckodriver

Problem

I updated Ubuntu packages, which included Firefox and I updated Selenium using pip3 cause that also depends on the Firefox version. But running my existing Python scripts that use Selenium popped this error:

FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'

Solution

Firefox now provides the geckodriver as a separate binary. You can download the version matching your OS and CPU here. Unzip the file and place the binary anywhere that is in your PATH. Your Python scripts should work now.

Reference

Tried with: Firefox 49, Selenium 3.0.1 and Ubuntu 16.04

Advertisements