How to Install Geckodriver for Python on a Windows Operating System
In this article, we show how to install geckodriver for Python on a windows operating system.
The geckodriver allows us to interact with Gecko-based browsers, such as Firefox. It provides an HTTP API to communicate with Gecko browsers.
So let's now go over how to install the geckodriver software.
If you have a 32-bit Windows PC, you can download this software: geckodriver-v0.28.0-win32
If you have a 64-bit Windows PC, you can download this software: geckodriver-v0.28.0-win64
Once you have downloaded this file and extracted it (being that it is a compressed file), then the next thing you have to do is add it to the Windows Path environment variable. This allows Windows to be able to locate the executable file of the program to run it. If you don't add it a path environment variable for it, the Windows operating system wouldn't know where the executable file is to run the program.
To add a path environment variable for the program, go to the Windows search bar at the bottom and type in, Edit Environment Variables.
The following should now be shown on your screen.
To edit path environment variables, click on 'Path' and click the 'Edit' button.
The following should now be shown on your screen.
Now that you're on this Screen, click 'Add' to put in another path variable. Add the complete path to the folder which contains the executable geckodriver program. You're not specifying the path to the executable file, but t to the folder that contains the executable file.
Once you've clicked 'Ok' twice, there should be a path environment variable to the geckodriver software on your Windows PC.
To test this out, open the Command Prompt on your Windows PC, and type in geckodriver.
If you see the following below,
this means that the geckodriver software on your PC is up and running.
You now have the geckodriver software capability and can now use it in Python code to open and control web browsers like Firefox.
And this is how to install the geckodriver software for Python in a Windows operating
system.
Related Resources
How to Create a Zip File in Python
How to Extract All Files and Folders from a Zip File in Python
How to Read the Contents of a Zip File in Python