python+selenium自动化测试定位下拉菜单并点击?? 5

请问怎么写下图中的菜单定位并点击的脚本;... 请问怎么写下图中的菜单定位并点击的脚本; 展开
 我来答
匿名用户
2016-04-13
展开全部
那就改用点击来解决.
先点击倒三角按钮, 然后点击option value="132"
另外select标签怎么有个editable=false ?
陪你编程
2016-04-12 · TA获得超过303个赞
知道小有建树答主
回答量:128
采纳率:20%
帮助的人:34.1万
展开全部

请参考selenium.webdriver.support.select的API.

select_by_visible_text(text)[source]

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 :

value - The value to match against

select_by_value(value)[source]

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 :

index - The option at this index will be selected

select_by_index(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 :

options

Returns a list of all options belonging to this select tag

first_selected_option

The first selected option in this select tag (or the currently selected option in a normal select)


完整的API见http://seleniumhq.github.io/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.select.html#selenium.webdriver.support.select.Select.deselect_by_value

本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式