I have following environment at my local
Chrome 67
Python 3.5.0
Selenium 3.12.0
I have downloaded chromedriver with version 2.39
I have .py file as follows
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome(executable_path="hromedriver.exe")
driver.get('http://www.google.com')
time.sleep(5)
search_box = driver.find_element_by_name('q')
search_box.send_keys('Python')
search_box.submit()
time.sleep(5)
driver.quit()
I am getting following error.
C:Python354python.exe D:/formf.py
Traceback (most recent call last):
File "D:/PCPNDT/form.py", line 4, in <module>
driver = webdriver.Chrome(executable_path="chromedriver.exe") # Optional argument, if not specified will search path.
File "C:Python354libsite-packagesseleniumwebdriverchromewebdriver.py", line 68, in __init__
self.service.start()
File "C:Python354libsite-packagesseleniumwebdrivercommonservice.py", line 104, in start
raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service chromedriver.exe
I also tried with other webdriver like geckodriver.exe still same error.
Please help me out to resolve this error.
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…