my code is
designation=driver.find_element(By.CLASS_NAME,"suggestor-input")
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
Solution
step1:
pip install --upgrade selenium
update the selenium to recent version 4.11.2, it will automatically download the recent driver do not need to update driver manually
step2:
before updating selenium delete the previous webdriver in C drive. in environment variable also
step3: then use command
driver=webdriver.Chrome()
step4 run the commands
driver.get("https://www.naukri.com/")
then we will one browse automatically open
Another solution
from selenium import webdriver
driver = webdriver.Chrome(executable_path= r'C:\Utility\BrowserDrivers\chromedriver.exe')
Top comments (0)