关于chromedriver.exe报错的解决办法

During handling of the above exception, another exception occurred

Traceback (most recent call last):
File “headless_chrome_for_sht.py”, line 10, in
browser = webdriver.Chrome(executable_path = ‘F:\test\chromedriver.exe’, chrome_options = chrome_options)
File “F:\python\lib\site-packages\selenium\webdriver\chrome\webdriver.py”, line 73, in init
self.service.start()
File “F:\python\lib\site-packages\selenium\webdriver\common\service.py”, line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver.exe’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

如果提示上面的错误时,
browser = webdriver.Chrome(executable_path = ‘C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe’, chrome_options = chrome_options)
需要在executable_path 里面将chromedriver.exe的准确链接写进去,然后,系统的path里面将该位置加进去,而且这个驱动应该要在google chrome的根目录

你可能感兴趣的:(学习历程,python,selenium,spidermonkey)