7dao

下拉列表

1.非select 直接定位

先定位头部元素,然后定位选择框,如下例:

 

 

 

 

2.Select元素


#1.先找到select元素

select_ele=driver.find_element_by_xpath()

#2.实例化Select类

s=Select(select_ele)

#3.选择下拉列表值

s.select_by_index(0)

 

分类:

技术点:

相关文章:

  • 2021-12-09
  • 2022-01-07
  • 2021-07-22
  • 2021-11-05
  • 2021-08-14
  • 2022-01-05
  • 2022-12-23
  • 2021-08-22
猜你喜欢
  • 2021-05-19
  • 2021-06-30
  • 2022-12-23
  • 2021-11-18
  • 2021-11-28
  • 2022-12-23
相关资源
相似解决方案