How to Install ChromeDriver for Python on a Windows Operating System



Python


In this article, we show how to install ChromeDriver for Python on a windows operating system.

The ChromeDriver allows us, through Python code, to interact with the google chrome web browser.

So let's now go over how to install the ChromeDriver software.

The page that contains all of the different downloads for the ChromeDriver softwares is shown at the following link: ChromeDriver Downloads.

The version of the ChromeDriver that you want to install should be compatible with the type of Chrome browser that you currently have.

If you download a ChromeDriver version that isn't compatible with the Chrome browser that you have, the software will not work.

You can find out the version of Chrome that you have by opening up the browser and selecting 'Help' and then 'About Google Chrome'

The version you have will be listed on that page.

An important point is that there is only one version for Windows that will work on both 32-bit and 64-bit Windows operating systems. You'll notice that when you look through the ChromeDriver Downloads page, for windows downloads, you always see the number 32. You may think that only 32-bit windows operating systems are supported. However, this is not the case. I have tested it on 64-bit windows operating systems, and it has worked. So both versions are supported.

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.

Editing path environment variables in Windows

To edit path environment variables, click on 'Path' and click the 'Edit' button.

The following should now be shown on your screen.

Adding a new path envionment variable for chromedriver in Windows

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.

Testing the chromedriver installation windows

You now have the ChromeDriver software capability and can now use it in Python code to open and control the google chrome web browser.

And this is how to install the ChromeDriver 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



HTML Comment Box is loading comments...