Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to use chromedriver But I am facing following error message: ‘chromedriver’ executable needs to be in PATH in python. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How message: ‘chromedriver’ executable needs to be in PATH Error Occurs ?
I am trying to use chromedriver But I am facing following error.
message: 'chromedriver' executable needs to be in PATH
How To Solve message: ‘chromedriver’ executable needs to be in PATH Error ?
How To Solve message: ‘chromedriver’ executable needs to be in PATH Error ?
To Solve message: ‘chromedriver’ executable needs to be in PATH Error You need to specify full path of chromedriver.exe Now your error must be solved Second solution is Just Use webdriver-manager which is automatically manage chromedriver. Just install this package: pip install webdriver-manager and third solution is Just add path string, begin with the letter
r
before the string, for raw string. I tested this way, and it works.message: ‘chromedriver’ executable needs to be in PATH
To Solve message: ‘chromedriver’ executable needs to be in PATH Error You need to specify full path of chromedriver.exe Now your error must be solved Second solution is Just Use webdriver-manager which is automatically manage chromedriver. Just install this package: pip install webdriver-manager and third solution is Just add path string, begin with the letter
r
before the string, for raw string. I tested this way, and it works.
Solution 1: specify full path of chromedriver.exe
You need to specify full path of chromedriver.exe. Here is Example code.
from selenium import webdriver
chrome_driver = webdriver.Chrome('C:\path\to\chromedriver.exe')
Now your error must be solved.
Solution 2: Use webdriver-manager
Just Use webdriver-manager which is automatically manage chromedriver. Just install this package.
pip install webdriver-manager
Then use this example code.
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
Solution 3: use raw string
Just add path string, begin with the letter r
before the string, for raw string. I tested this way, and it works.
driver = webdriver.Chrome(r"C:/Users/michael/Downloads/chromedriver_win32/chromedriver.exe")
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read