擅长:python、mysql、java
<p>您可以遍历所有选项,如下所示:</p>
<pre><code>element = driver.find_element_by_xpath("//select[@name='fruitType']")
all_options = element.find_elements_by_tag_name("option")
for option in all_options:
print("Value is: %s" % option.get_attribute("value"))
option.click()
</code></pre>