1.python+selenium实现web自动化----selenium的原理和安装
2020-04-22 17:19
621 查看
安装客户端库
pip install selenium
安装浏览器驱动(chrome)
https://chromedriver.storage.googleapis.com/index.html
下载 chromedriver_win32.zip,解压至d:\webdrivers\chromedriver.exe(注意放在没有空格和中文的目录)
下面的代码, 可以自动化的 打开Chrome浏览器,并且自动化打开百度网站,可以大家可以运行一下看看。
from selenium import webdriver
# 创建 WebDriver 对象,指明使用chrome浏览器驱动
wd = webdriver.Chrome(r'd:\webdrivers\chromedriver.exe')
# 调用WebDriver 对象的get方法 可以让浏览器打开指定网址
wd.get('https://www.baidu.com')
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- Python3+Selenium2完整的自动化测试实现之旅(四):Selenium-webdriver操作浏览器、Cookie、鼠标键盘、警示框、设置等待时间、多窗口切换
- 2.python+selenium实现web自动化----选择元素的基本方法
- python+selenium实现web自动化常用方法
- python使用selenium实现web系统自动化巡检
- Python3+Selenium2完整的自动化测试实现之旅(三):Selenium-webdriver提供的元素定位方法
- 4.python+selenium实现web自动化----CSS选择器
- 轻松自动化---selenium-webdriver(python) (十二)
- 轻松自动化---selenium-webdriver(python) (七)
- Python+Selenium 自动化实现实例-获取页面元素信息
- 轻松自动化---selenium-webdriver(python) (三)
- 轻松自动化---selenium-webdriver(python) (八)
- 轻松自动化---selenium-webdriver(python) 系列教程
- web自动化--PYTHON Selenium
- 轻松自动化---selenium-webdriver(python) (十一)
- Web自动化Selenium2环境配置中Selenium IDE的安装
- Python:的web爬虫实现及原理(BeautifulSoup工具)
- 轻松自动化---selenium-webdriver(python) (五)---层级定位
- python 和 selenium实现web UI功能自动化测试框架
- Selenium基于Python web自动化基础一 -- 基础汇总及简单操作
- Kickstart/Anaconda实现自动化安装原理探究二