擅长:python、mysql、java
<p>从<a href="http://selenium-python.readthedocs.io/navigating.html#filling-in-forms" rel="noreferrer">official documentation</a>:</p>
<pre class="lang-python prettyprint-override"><code>from selenium.webdriver.support.ui import Select
select = Select(driver.find_element_by_id('fruitType'))
# Now we have many different alternatives to select an option.
select.select_by_index(4)
select.select_by_visible_text("jumbo fruit 4")
select.select_by_value('4') #Pass value as string
</code></pre>