|
安装python2.7
安装setuptools-0.6c11.win32-py2.7.exe
安装ez_setup-0.9.tar.gz
安装selenium-2.47.1.tar.gz
下载chromeDriver.exe 或 下载IEDriverServer.exe 放入C:\Windows\System32
实例:
# coding = utf-8
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
import time
driver = webdriver.Chrome() #打开谷歌浏览器
driver.get("http://www.baidu.com") #打开百度主页
driver.find_element_by_id("kw").send_keys('python') #输入python
driver.find_element_by_id("su").click() #点击搜索
*****************************感谢网友*****************************
轻松自动化---selenium-webdriver(python) (一) http://www.cnblogs.com/fnng/p/3160606.html
python开发_webbrowser_浏览器控制模块
http://www.cnblogs.com/hongten/archive/2013/09/20/hongten_python_webbrowser.html
Selenium + python的自动化框架搭建 .
http://blog.csdn.net/five3/article/details/7030704
selenium + python自动化测试环境搭建
http://www.cnblogs.com/fnng/archive/2013/05/29/3106515.html
Python Selenium自动化(一)点击页面链接测试
http://www.51testing.com/html/21/n-862721.html
用selenium python登录网站并抓取登录后的内容
http://blog.bccn.net/%E9%9D%99%E5%A4%9C%E6%80%9D/16744
*****************************感谢网友***************************** |