1. 程式人生 > >WebDriverException:Message:'geckodriver'executable needs to be in Path

WebDriverException:Message:'geckodriver'executable needs to be in Path

我在windows10 下 做 Selenium WebDriver 啟動 瀏覽器需要載入瀏覽器的驅動,這裡 由於高版本的 火狐瀏覽器需要 下載

geckodriver-v0.16.1

下載地址: http://download.csdn.net/detail/qianaier/9834895 放到 :C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32 
#coding=utf-8
from selenium import webdriver

driver=webdriver.Firefox()
driver.get("https://www.baidu.com/"
) driver.find_element_by_id("kw").send_keys("Selenium2") driver.find_element_by_id("su").click() driver.quit()