Error: selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

in selenium
selenium Tutorials
3 Answers to this question

You can test if it actually is in the python PATH, if you open a cmd and type in chromedriver and hit Enter. If Starting ChromeDriver 2.15.322448 is appearing, the PATH is set appropriately and there is something else going wrong. Then try the following:

Download ChromeDriver

Then you have multiple options:

* Add it to your system path
* Put it in the same directory as your python script
* Specify the location directly via executable_path

driver = webdriver.Chrome(executable_path='C:/path/to/chromedriver.exe')

 

The following code has to be executed with the Python script.

1.In command line: pip install webdriver-manager
2.Python script: 
from selenium import webdriver

from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())

test

If you want to unleash your potential in this competitive field, please visit the Selenium Certification Training page for more information, where you can find the    Selenium Tutorial    and    Selenium Interview Questions FAQ's and answers    as well.

For more updates on the latest courses stay tuned to HKR Trainings.

To Top