【发布时间】:2020-08-06 09:13:02
【问题描述】:
您好,我无法选择下拉选项..
示例下拉列表:https://demos.telerik.com/kendo-ui/dropdownlist/angular
我想选择 'STATIC DAT' 作为 'Austria' sung selenium python。
我可以点击下拉菜单,所有菜单都可见,但无法选择任何选项。
我试过的示例代码:
xpath = r'/html/body/div[4]/div[2]/div[2]/div/div/span[1]/span/span[2]'
element_inst = web_driver.find_element_by_xpath(xpath)
# Click dropdown list
psu.perform_action(web_driver, element_inst, 'click')
# Select option
web_driver.find_element_by_xpath("//span[text()='Austria']").click()
有什么解决办法吗?谢谢
【问题讨论】:
标签: python python-3.x selenium selenium-webdriver selenium-chromedriver