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

展开全部

请参考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:

Bar

Args :

value - The value to match againstselect_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:

Bar

Args :

index - The option at this index will be selectedselect_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见e5a48de588b662616964757a686964616f31333339663963http://seleniumhq.github.io/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.select.html#selenium.webdriver.support.select.Select.deselect_by_value

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值