There are a few ways you can go about this:
Using Chocolatey
The easiest way I've found to install chromedriver is to use chocolatey. You can follow the instructions to install it here, and once it's installed, just run choco install chromedriver
(as an administrator), and it should install chromedriver for your version of chrome.
Then in your code, just remove the reference to chromedriver's path:
Before:
driver = webdriver.Chrome(executable_path='c:\path\to\windows\webdriver\executable.exe')
After:
driver = webdriver.Chrome()
Manually
If you don't want to use chocolatey, then follow these steps
- Go to
chrome://version/
in Chrome, to check your current version. As you can see it's version 89
for me:

- Go to chromedriver.chromium.org/downloads and download the version of chromedriver that's the same as your browser version:

- Download the right version for your OS. For example, if you are using Windows, download the
win_32
one:

- Extract the .ZIP and place
chromedriver.exe
in the same folder as your Python program:

- Change the path to chromedriver to just
chromedriver.exe
:
Before:
driver = webdriver.Chrome(executable_path='c:\path\to\windows\webdriver\executable.exe')
After:
driver = webdriver.Chrome(executable_path='chromedriver.exe')
...and you should be good to go.
Adding chromedriver to the PATH
If you want to add chromedriver to the PATH so you don't have to worry about where chromedriver is each time you write a selenium program, then it'd be a good idea to just use chocolatey, because it should install it globally. It's also much easier, so go with that if you can. However, you can still set chromedriver to the PATH manually, following these steps (for Windows):
- Open Command Prompt. Create a directory at
C:\bin
by running
cd /
...then:
mkdir bin
...then:
cd bin
...then:
explorer .
This should open the folder in File Explorer:

- Place chromedriver.exe in this folder
- Set it to the PATH by running, in Command Prompt:
setx PATH "%PATH%;C:\bin"
You should get something like this:

- Close and reopen Command Prompt
- Verify setup by running
chromedriver -v
. You should get something like this:
C:\Users\You>chromedriver -v
ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761})
If so, you're all done.
Instructions for adding to PATH were adapted from here. For other operating systems, see here.