
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
WebDriverException: Chromedriver Executable Needs to be in PATH
We can get the error selenium.common.exceptions.WebDriverException if the path of the chromedriver.exe executable file is not set properly or incorrect within the webdriver.Chrome(). The below image shows such an exception.
It can be resolved by the following ways −
Verify the path of the chromedriver.exe file set within webdriver.Chrome.
Install the webdriver manager with the command: pip install webdrivermanager. Then add the statement: from webdriver_manager.chrome import ChromeDriverManager in our code.
Example
Code Implementation with webdriver manager
from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager #configure webdriver manager driver = webdriver.Chrome(ChromeDriverManager().install()) driver.implicitly_wait(0.5) #launch URL driver.get("https://www.tutorialspoint.com/index.htm") print("URL is: ") print(driver.current_url) driver.close()
Output
Advertisements