python selenium 相关操作
selenium :
是一个用于Web应用程序测试的工具。Selenium测试直接运行在浏览器中,就像真正的用户在操作一样。支持的浏览器包括IE(7, 8, 9, 10, 11),Mozilla Firefox,Safari,Google Chrome,Opera等。这个工具的主要功能包括:测试与浏览器的兼容性——测试你的应用程序看是否能够很好得工作在不同浏览器和操作系统之上。测试系统功能——创建回归测试检验软件功能和用户需求。支持自动录制动作和自动生成 .Net、Java、Perl等不同语言的测试脚本。
- Google Chrome
- Internet Explorer 7, 8, 9, 10, 11
- Firefox
- Safari
- Opera
- HtmlUnit
- phantomjs
- Android
- iOS
|
Browser
|
Selenium IDE
|
Selenium Remote Control
|
Selenium Core
|
Selenium 2/Webdriver API
|
|---|---|---|---|---|
|
Firefox 10
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Firefox 9
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Firefox 8
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Firefox 7
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Firefox 6
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Firefox 5
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Firefox 4
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Firefox 3.6
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Firefox 3
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
not supported
|
|
IE 9
|
not supported
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
IE 8
|
not supported
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
IE 7
|
not supported
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Safari 3
|
not supported
|
Start browser, run tests
|
Run tests
|
not supported
|
|
Safari 2
|
not supported
|
Start browser, run tests
|
Run tests
|
not supported
|
|
Opera 9
|
not supported
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Opera 8
|
not supported
|
Start browser, run tests
|
Run tests
|
Run tests
|
|
Chrome
|
not supported
|
Start browser, run tests***
|
Run tests***
|
Run tests***
|
|
Others
|
not supported
|
Partial support possible*
|
Run tests**
|
not supported
|
selenium相关操作
安装: pip install selenium
支持的浏览器:

导入模块:
from selenium import webdriver
浏览器插件(谷歌):链接:https://pan.baidu.com/s/17xk-6GXeach_HZTWo-AUqg
提取码:vdlj
启动浏览器:
bro = webdriver.Chrome(executable_path = r"F:\chromedriver.exe")
模拟请求地址:
bro.get("https://koudashijie.com/teachers/classes")
找到输入框,拿到前端页面ID
text_input = bro.find_element_by_id('kw')
输入内容
text_input.send_keys("蒸汽创客")
模拟提交按钮
login_btn = bro.find_element_by_id("su").click()
拿到页面
bro.page_source
python selenium 相关操作的更多相关文章
- python文件相关操作
Python文件相关操作 打开文件 打开文件,采用open方法,会将文件的句柄返回,如下: f = open('test_file.txt','r',encoding='utf-8') 在上面的代码中 ...
- python 集合相关操作
集合相关操作 集合是一个无序的,不重复的数据组合,它有着两个主要作用:去重以及关系测试. 去重指的是当把一个列表变成了集合,其中重复的内容就自动的被去掉了 关系测试指的是,测试两组数据之间的交集.差集 ...
- python集合相关操作
集合相关操作 集合是一个无序的,不重复的数据组合,它有着两个主要作用:去重以及关系测试. 去重指的是当把一个列表变成了集合,其中重复的内容就自动的被去掉了 关系测试指的是,测试两组数据之间的交集.差集 ...
- python PIL相关操作
项目中需要用python生成二维码,这里记录一下相关PIL相关操作. RGBA问题: 需要将图片A粘贴到图片B上,之前没有注意透明度问题,A的背景是透明的,粘贴到B上后,A的周围是黑的.后来才发现是P ...
- Python容器相关操作
(集合与字典除外)的容器相关操作 (1)容器的拼接 >>> 'abc' + 'def' 'abcdef' (2)容器的重复 >>> (1, 2) * 3 (1, 2 ...
- python subprocess相关操作
python subprocess常用操作 1.subprocess模块的常用函数 函数 描述 subprocess.run() Python 3.5中新增的函数.执行指定的命令,等待命令执行完成后返 ...
- python selenium --browser 操作
本节知识点: 打印URL 将浏览器最大化 设置浏览器固定宽.高 操控浏览器前进.后退 打印URL 上一节讲到,可以将浏览器的title打印出来,这里再讲个简单的,把当前URL打印出来.其实也没啥大用, ...
- 初学Python——字符串相关操作
基本字符串操作 Pyhton中字符串的格式化输出在前面已经总结了,接下来介绍一些常用的字符串操作 先定义一个字符变量,以下的操作都以此为例: name=" my name is china ...
- python 字典相关操作
字典 字典的增删改查 字典的创建方式: # 创建字典类型 info = { 'name':'李白', 'age':'25', 'sex':'男' } msg = { 'user01':'Longzel ...
随机推荐
- C#, 计算字符串里有多少个指定字符
int number = a.Count<char>(c => c == '@');
- Dynamic Web TWAIN——网页扫描SDK
下载地址:[https://www.dynamsoft.com/Support/DWTGuide/Dynamic%20Web%20TWAIN%20SDK.html] API:[http://devel ...
- 浏览器访问ipv6站点(未绑定主机的ipv6站点)
我们在浏览器直接输入ipv6地址敲回车,一般情况下浏览器会跳转到搜索引擎进行搜索. 我们需要在浏览器器中输入: http://[::1] 或者 [::1]
- Matlab学习笔记0—课程导入
0,Matlab语言的介绍 1.什么叫计算? 在汉语中,“计算”一词的含义: 谋划 ,考虑 , 算计.随着电子计算机的产生与应用,人们对“计算”的理解发生了很大的变化. (1) ...
- 问题记录 | 记录PIL中Image.save的一个坑
Image.save然后open数值是会变的 我找了一个下午终于找出问题所在,PIL的Image库中把图片resize了之后存在本地然后再读进来,与直接resize后的数值是不一样的. data_va ...
- Oracle恢复ORA-00600: 内部错误代码, 参数: [kcratr_scan_lastbwr] 问题的简单解决
Oracle恢复ORA-00600: 内部错误代码, 参数: [kcratr_scan_lastbwr] 1. 简单处理 sqlplus / as sysdba startup mount recov ...
- C++中的三种继承方式
1,被忽略的细节: 1,冒号( :)表示继承关系,Parent 表示被继承的类,public 的意义是什么? class Parent { }; class Child : public Parent ...
- MyBatis按时间排序
测试代码 ActivityReadExample readExample = new ActivityReadExample(); readExample.setOrderByClause(" ...
- dhcp协议简介
协议分析 - DHCP协议解码详解 DHCP协议简介 DHCP,全称是 Dynamic Host Configuration Protocol﹐中文名为动态主机配置协议,它的前身是 BOOTP,它工作 ...
- java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter的解决方案
白天在实验室的电脑上的项目搭起来,晚上回到宿舍发现跑不起来了,网上查到的大多不是想要的答案. 最终的解决方案是maven clean一下再重新package.