【发布时间】:2019-11-24 03:41:00
【问题描述】:
我有这个 ID 为“drp_autogen0”的下拉列表。我想单击下拉菜单以查看下拉选项。当我尝试使用 Python 和 Selenium 单击它时,出现此错误:selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable 我附上了下拉列表的打印屏幕。我希望能够从列表中选择“上个月”,但我还没有走那么远,因为没有点击下拉菜单。 https://snipboard.io/xDM1Un.jpg
下拉点击的代码在这里:
html_list = driver.find_element_by_id("drp_autogen0")
html_list.click()
下拉按钮的网页代码是:
<button type="button" class="comiseo-daterangepicker-triggerbutton ui-button ui-corner-all ui-widget comiseo-daterangepicker-bottom" id="drp_autogen0">22 Nov 2019<span class="ui-button-icon-space"> </span><span class="ui-button-icon ui-icon ui-icon-triangle-1-s"></span></button>
上个月的网页代码是:
<div id="ui-id-5" tabindex="-1" role="menuitem" class="ui-menu-item-wrapper">Last month</div>
【问题讨论】:
标签: javascript python html selenium