【Python+Selenium学习系列5-1】Selenium特殊元素定位之-下拉框元素定位Select操作

背景

对于页面中的下拉框选项,使用selenium的select模块可以进行操作,并精确定位下拉选项及所有的option值。
select模块方法一共分为三个部分:option方法、选中方法、取消选中方法,下面具体看一下这三个部分

1、select模块中关于option选项的方法:

  • options:返回所有的option选项
  • all_selected_options:返回所有选中的option选项
  • first_selected_option:返回第一个选中的option选项

自定义一个下拉框页面select元素.html




    
    
    
    

你可能感兴趣的:(Selenium,selenium,测试工具,python)