簡體   English   中英

python3如何使用硒單擊下拉框

[英]python3 How do I click dropdown box using selenium

我正在嘗試在python3上使用硒單擊Dropbox。 但我收到一個錯誤消息。

 raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchWindowException: Message: Unable to find element on closed window

我的代碼如下。

driver.find_element_by_css_selector("#RegularCategory>div.pagination dl.dropdown dt a span").click()

and..code是...我想單擊“排序依據”,但我不能。 在此處輸入圖片說明

您可以使用硒的select類及其API,例如select_by_index或select_by_value:參考: [http://selenium-python.readthedocs.io/api.html]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM