Python+selenium中如何定位以下下拉框select中的元素,尝试了很多种方法都不行

图片说明

用这个可以打印出下拉框的内容

select=driver.find_element_by_name("bean.type")

options_list=select.find_elements_by_tag_name('option')

for option in options_list:

print("Value is:%s Text is:%s" %(option.get_attribute("value"),option.text))

但是试了好多方法都无法选择到对应的下拉框内容

这个下拉框需要点击或者鼠标覆盖操作吧
先执行这个操作,再获取html

options_list=select.find_elements_by_tag_name('option')这个select说明什么,findelement前面的self是浏览器对象,就是你之前driver = driver.chrome的那个driver

导入select的类了吗 用select对象引用了吗?