Fix Selenium ‘chromedriver’ executable needs to be in PATH – Python Tutorial

By | November 25, 2020

When we are using selenium in python, we may find ‘chromedriver’ executable needs to be in PATH error. In this tutorial, we will introduce how to fix this problem.

Here is an example:

from selenium import webdriver

driver = webdriver.Chrome()

Run this code, you will get error:

Fix Selenium 'chromedriver' executable needs to be in PATH - Python Tutorial

How to fix this path error?

In order to fix this problem, we should tell the path of chromedriver.exe for webdriver.

Here is the solution.

driver = webdriver.Chrome(executable_path=r"E:\Program Files\chromedriver.exe")

E:\Program Files\chromedriver.exe is the path of chromedriver.exe, then you will find this path error is fixed.

Leave a Reply

Your email address will not be published. Required fields are marked *