Python 3.x 如何通过selenium python3从下拉按钮中选择项目?
我正在尝试在一个下拉菜单中自动执行单击过程,如下所示 我的源html文件看起来像是“加入会话”按钮,单击“加入会话”后,下拉列表将打开并向我们显示课程室 我已经尝试了下面的代码Python 3.x 如何通过selenium python3从下拉按钮中选择项目?,python-3.x,selenium-webdriver,automation,Python 3.x,Selenium Webdriver,Automation,我正在尝试在一个下拉菜单中自动执行单击过程,如下所示 我的源html文件看起来像是“加入会话”按钮,单击“加入会话”后,下拉列表将打开并向我们显示课程室 我已经尝试了下面的代码 browser.find_element_by_id('sessions-list-dropdown').click() time.sleep(2) browser.find_element_by_link_text('Course Room').click() 但是我犯了一个错误 selenium.common.ex
browser.find_element_by_id('sessions-list-dropdown').click()
time.sleep(2)
browser.find_element_by_link_text('Course Room').click()
但是我犯了一个错误
selenium.common.exceptions.ElementNotInteractableException: Message: Element <button id="sessions-list-dropdown" class="select-value join-session button-anchor"> could not be scrolled into view
selenium.common.exceptions.InvalidSelectorException: Message: Given css selector expression "ng-show#courseOutline.activeSessionCount() >= 1" is invalid: InvalidSelectorError: Document.querySelector: 'ng-show#courseOutline.activeSessionCount() >= 1' is not a valid selector: "ng-show#courseOutline.activeSessionCount() >= 1"
帮我自动点击那些按钮。。
谢谢各位: