Debug School

rakesh kumar
rakesh kumar

Posted on

Selenium Error:name 'driver' is not defined

my code is
when i run it i got error

NameError                                 Traceback (most recent call last)
Cell In[1], line 1
----> 1 designation=driver.find_element(By.CLASS_NAME,"suggestor-input")
      2 designation.send_keys('Data Analyst')

NameError: name 'driver' is not defined
Enter fullscreen mode Exit fullscreen mode


pip install --upgrade selenium
Enter fullscreen mode Exit fullscreen mode

update the selenium to recent version 4.11.2, it will automatically download the recent driver do not need to update driver manually


before updating selenium delete the previous webdriver in C drive. in environment variable also

step3: then use command

Enter fullscreen mode Exit fullscreen mode

step4 run the commands

then we will one browse automatically open
Image description

Another solution
from selenium import webdriver
driver = webdriver.Chrome(executable_path= r'C:\Utility\BrowserDrivers\chromedriver.exe')

Top comments (0)