除非您的点击触发了某种Ajax调用来填充列表,否则您实际上不需要执行该点击。
只需找到元素,然后枚举选项,然后选择所需的选项即可。
这是一个例子:
from selenium import webdriverb = webdriver.Firefox()b.find_element_by_xpath("//select[@name='element_name']/option[text()='option_text']").click()您可以在以下网址阅读更多信息:https :
//sqa.stackexchange.com/questions/1355/unable-to-select-an-option-using-
seleniums-python-
webdriver



