selenium示例

安装selenium

pip install -U selenium

下载:chromedriver.exe

http://chromedriver.storage.googleapis.com/2.9/chromedriver_win32.zip

请将chromedriver.exe放到<Install Dir>/Python27/Scripts/目录下

For windows, please have the chromedriver.exe placed under <Install Dir>/Python27/Scripts/

编写代码:

# coding = utf-8

from selenium import webdriver

driver = webdriver.Chrome()
driver.get('http://www.baidu.com')
driver.close()


[参考文献]

http://stackoverflow.com/questions/8255929/running-webdriver-chrome-with-selenium

你可能感兴趣的:(selenium示例)