# _*_ coding:utf-8_*_
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.baidu.com")
driver.find_element_by_id("kw").send_keys("Selenium2")
driver.find_element_by_id("su").click()
The solution is to install the browser driver
Install the three major browser drivers
1.chromedriver download address: https://code.google.com/p/chromedriver/downloads/list
2. Firefox's driver geckodriver download address: https://github.com/mozilla/geckodriver/releases/
3. IE driver IEdriver download address: http://www.nuget.org/packages/Selenium.WebDriver.IEDriver/
Note: After downloading and decompressing, send chromedriver.exe , geckodriver.exe , Iedriver.exe to the Python installation directory, such as D:\python . Then add the Python installation directory to the Path of the system environment variable.