WebDriver-Python-下拉菜单中有多少个元素 [英] WebDriver - Python - How many elements in a drop-down menu
本文介绍了WebDriver-Python-下拉菜单中有多少个元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试计算一个下拉菜单中有多少个元素.我的部分代码是:
i try to count how many element have a drop-down menu. Part of my code is :
while a < ? :
Select(driver.find_element_by_id("MyBox")).select_by_index(a)
a += 1
其他选项是通过索引检查元素是否存在,但是我无法找到解决方案.
Other option is to check by index if element exists, but i'm not able to found the solution.
推荐答案
查看全文