selenium Select用法笔记
- select_by value:参数为option中的value属性,例如:HTML代码中 <ignore_js_op>
,应该是value="volvo"这个值,所以应该为小写;
- select_by_visible_text:参数为option的text值, <ignore_js_op>
,应该是红线标出部分的值,所以应该是大写;
- Select(driver.find_element_by_name("isImportant")).select_by_visible_text(u"是")
- deselect_all(self)
| Clear all selected entries. This is only valid when the SELECT supports multiple selections.
| throws NotImplementedError If the SELECT does not support multiple selections
- select_by_index(self, index)
| Select the option at the given index. This is done by examing the "index" attribute of an
| element, and not merely by counting.
|
| :Args:
| - index - The option at this index will be selected
|
| throws NoSuchElementException If there is no option with specisied index in SELECT
- select_by_value(self, value)
| Select all options that have a value matching the argument. That is, when given "foo" this
| would select an option like:
|
| <option value="foo">Bar</option>
|
| :Args:
| - value - The value to match against
|
| throws NoSuchElementException If there is no option with specisied value in SELECT
|
- select_by_visible_text(self, text)
| Select all options that display text matching the argument. That is, when given "Bar" this
| would select an option like:
|
| <option value="foo">Bar</option>
|
| :Args:
| - text - The visible text to match against
|
| throws NoSuchElementException If there is no option with specisied text in SELECT
selenium Select用法笔记的更多相关文章
- python+selenium七:下拉框、选项框、select用法
# from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChainsimpo ...
- Selenium Grid 学习笔记
Selenium Grid 学习笔记http://www.docin.com/p-765680298.html
- jquery中关于append()的用法笔记---append()节点移动与复制之说
jquery中关于append()的用法笔记---append()节点移动与复制之说 今天看一本关于jquery的基础教程,看到其中一段代码关于append()的一行,总是百思不得其解.于是查了查官方 ...
- html select用法总结
本文将介绍select 原生的常用方法,这些都是经过测试,兼容ie6到ie10,及chrome,火狐等,也就是说大部分浏览器都兼容.如果大家发现有不兼容的情况,可以跟我留言. 我们对基本的用法了如指掌 ...
- 网络通信 --> select()用法
select()用法 头文件 #include <sys/time.h> #include <sys/types.h> #include <unistd.h> 定义 ...
- 【Python爬虫】selenium基础用法
selenium 基础用法 阅读目录 初识selenium 基本使用 查找元素 元素互交操作 执行JavaScript 获取元素信息 等待 前进后退 Cookies 选项卡管理 异常处理 初识sele ...
- golang学习之select用法
早期的select函数是用来监控一系列的文件句柄,一旦其中一个文件句柄发生IO操作,该select调用就会被返回.golang在语言级别直接支持select,用于处理异步IO问题. select用法同 ...
- 数据库Oracle的select用法(部分)
Oracle的select用法(部分): 1.查询所有: select * from employees; 2.加上where子句:用选择限制行 select * from employees whe ...
- <自动化测试>之<selenium API 用法2>
不知道之前的selenium API 用法1,有没有去练习, 个人认为线性代码还是要靠敲的, 后面的模块化除了多敲还需要一定的编程思想去理解, 今天下午不是很忙就给来这儿补充点selenium api ...
随机推荐
- sql如何先排序再去重
场景 有一张得分表(score),记录了用户每次的得分,同一个人可能有多个得分. id name score 1 tom 45 2 jack 78 3 tom 34 . . . 需求:找出分数最高的前 ...
- BZOJ5011 [JXOI2017]颜色 【线段树 + 主席树】
题目链接 BZOJ5011 题解 一定只有我这种智障会用这么奇怪的方法做这道题.. 由题我们知道最后剩余的一定是一个区间,而且区间内的颜色不存在于区间外 所以我们的目的就是为了找到这样的区间的数量 区 ...
- THUSC2014酱油记
Day0: 坐飞机到北京,然后报到...跟jason_yu分到一个房间,刚好可以蹭点RP.发现房间460RMB/晚,但再带一份早餐就500RMB,难道早餐是40RMB么...在一家川菜馆吃的午晚餐,感 ...
- 【BZOJ2134】单选错位 概率DP
一句话:有一些看似有关系的期望在把事件全面发生之后就变得相互独立了 #include<cstdio> using namespace std; ]; double ans; int mai ...
- How do I see what character set a database / table / column is in MySQL?
Q: How do I see what the character set that a MySQL database, table and column are in? Is there some ...
- codeforces 1060 D
https://codeforces.com/contest/1060/problem/D 题意:你可以用1个及以上的圆桌,给n个人排座位,每个人左边需要有Li个空凳子,右边需要有Ri个空凳子,问你最 ...
- 两数之和 [ leetcode ]
原题地址:https://leetcode-cn.com/articles/two-sum/ 给定一个整数数组和一个目标值,找出数组中和为目标值的两个数. 你可以假设每个输入只对应一种答案,且同样的元 ...
- pip 使用国内源
常用国内的pip源如下:阿里云 http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple ...
- 【LibreOJ】【LOJ】#6217. 扑克牌
[题意]给定一叠n张扑克牌和各自的ai,bi.每次可以从最上面拿走连续atop张并获得btop的价值,或是把top放到最底,求最大价值. [算法]背包DP [题解]本题最大的特点:atop的需求与牌的 ...
- SELinux 案例 2
普通进程权限白名单 sepolicy generate --application [-n NAME] [-u USER ]command [-w WRITE_PATH ]