![](/img/trans.png)
[英]How to get all options from ul li drop-down using Selenium Webdriver with Python?
[英]How to find length of drop-down with mat-options with Selenium Webdriver with Python?
您的元素不是 HTML select
标记,并且无法在其上使用 Selenium 的Select
类。 而是在div.mat-select-content
下获取所有带有标签mat-option
元素:
selectOptions = drowser.find_elements_by_css_selector("div.mat-select-content mat-option")
print len(selectOptions)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.