Selenium-WebDriver API

seleniumhq官方文档:

http://docs.seleniumhq.org/docs/03_webdriver.jsp

Selenium Python文档:

http://selenium-python.readthedocs.io/getting-started.html

Selenium简单的用法示例

-- coding:utf-8 --import osfrom selenium import webdriverfrom selenium.webdriver.common.keys import Keyschromedriver = "./chromedriver"driver = webdriver.Chrome(executable_path=chromedriver)print 'start'driver.get("http://www.baidu.com/")assert u"百度一下" in driver.titleelem = driver.find_element_by_name("wd")elem.send_keys("selenium")elem.send_keys(Keys.RETURN)assert "selenium" in driver.titleprint 'end'#driver.close()