I want to use Selenium on Python but I have an alert message:
driver-webdriver.Chrome("D:\Selenium\Chrome\chromedriver.exe") NameError: name 'driver' is not defined
I have installed the Chrome Driver, what else must I do ?
I want to use Selenium on Python but I have an alert message:
driver-webdriver.Chrome("D:\Selenium\Chrome\chromedriver.exe") NameError: name 'driver' is not defined
I have installed the Chrome Driver, what else must I do ?
Here is the Answer to your Question:
While working with Selenium 3.4.3, chromedriver v2.30 and Google Chrome v59.0 through Python 3.6.1 you neither need to install chromedriver nor need to copy in to any path. You can save the chromedriver in any location on your machine. To initiate the WebDriver instance you can explicitly call the chromedriver by passing the absolute path of the chromedriver through the argument executable_path as follows:
from selenium import webdriver
driver = webdriver.Chrome(executable_path= r'C:\\Utility\\BrowserDrivers\\chromedriver.exe')
Let me know if this Answers your Question.
chromedriver.exe must be in python path, probably now python expects that driver exists in "D:\Selenium\Chrome\chromedriver.exe" but it does not. You could try add chromedriver.exe path to windows enviroment path variable, or add path to os.path in python, or add driver to folder of python script.