I am trying to use selenium in python and for some reason I cannot modify the PATH so I can only specify the location of browser driver. However, I tried several drivers and none of them worked.
Environment: Windows 7, Anaconda3-python3.6.1, selenium3.4.3, chrome59.0.3071.115 (Official Build) (64-bit), chromedriver2.30 (win32).
Here are a part of the code I have tried and the corresponding error.
from selenium import webdriver
driver = webdriver.Chrome("I:\chromedriver.exe")
Traceback (most recent call last):
File "", line 1, in driver = webdriver.Chrome("I:\chromedriver.exe")
File "C:\Users\yz\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in init self.service.start()
File "C:\Users\yz\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 96, in start self.assert_process_still_running()
File "C:\Users\yz\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 109, in assert_process_still_running % (self.path, return_code)
WebDriverException: Service I:\chromedriver.exe unexpectedly exited. Status code was: 1
pathto the driver correct? should be something like this formatC:\\phantomjs-2.1.1-windows\\phantomjs- PYAdriver = webdriver.Chrome("I:\\chromedriver")but got the same error - ClaudiaI:\\chromedriver.exe- PYA