Recently I needed to scrap some data using selenium on python. I never actually used selenium before, but I do have experience with other headless web browsers. Anyways, when I first installed selenium from the python console using pip install selenium --user
and ran the code, it gave me a message saying
Message: 'geckodriver' executable needs to be in PATH.
Basically there were two issues at hand
- I did not have gecko driver installed.
- Windows couldn’t find the path to my geckodriver file.
To solve this, you need to
- Download geckodriver here. Choose Windows x32 or x64 accordingly.
- The cleanest way, without bloating your path environment variables, is to put geckodriver.exe, the file downloaded from step 1, into your Python folder. This is because there is usually a path environment variable set to your python directory, and it its path is usually like
C:\Program Files\Python35
.
Done. Now when you run your code again, everything should work fine.
Be First to Comment