I am having issues getting an instance of a Chrome browser from selenium in python. I'm using Windows 8. I have downloaded the chromedriver binary and added it to my path but I get the following error in Python:
selenium.common.exceptions.WebDriverException: Message: 'ChromeDriver executable needs to be available in the path.
This error occurs for the following line:
driver = webdriver.Chrome(executable_path='path\to\chromedriver_win32_2.0')
Through WebDriver, Selenium supports all major browsers on the market such as Chrome/Chromium, Firefox, Internet Explorer, Edge, and Safari.
Below are the steps to follow while configuring the chrome setup for Selenium. #1) Check the version of the chrome. #3) Download the chromedriver.exe file for the respective OS and copy that .exe file into your local. #4) The path of the chromedriver (C:\webdriver\chromedriver.exe) will be used in our program.
Two ways to set it, you somehow mixed up.
Put the chromedriver.exe
's path into PATH
(on Windows), so your PATH
setting is correct, but you need to call the default constructor.
driver = webdriver.Chrome()
Specify the path in webdriver.Chrome(executable_path='some path')
. Here you need the full path to the executable, not the directory.
webdriver.Chrome(executable_path=r'C:\Users\HaranKumar\Downloads\chromedriver_win32_2.0\chromedriver.exe')
Choose either one you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With