Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 如何通过selenium python3从下拉按钮中选择项目?_Python 3.x_Selenium Webdriver_Automation - Fatal编程技术网

Python 3.x 如何通过selenium python3从下拉按钮中选择项目?

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

我正在尝试在一个下拉菜单中自动执行单击过程,如下所示

我的源html文件看起来像是“加入会话”按钮,单击“加入会话”后,下拉列表将打开并向我们显示课程室

我已经尝试了下面的代码

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"
帮我自动点击那些按钮。。 谢谢各位: