2016-04-13
先点击倒三角按钮, 然后点击option value="132"
另外select标签怎么有个editable=false ?
请参考selenium.webdriver.support.select的API.
select_by_visible_text(text)[source]
Select all options that display text matching the argument. That is, when given “Bar” this would select an option like:
<option value=”foo”>Bar</option>
Args :
value - The value to match against
select_by_value(value)[source]
Select all options that have a value matching the argument. That is, when given “foo” this would select an option like:
<option value=”foo”>Bar</option>
Args :
index - The option at this index will be selected
select_by_index(index)
Select the option at the given index. This is done by examing the “index” attribute of an element, and not merely by counting.
Args :
options
Returns a list of all options belonging to this select tag
first_selected_option
The first selected option in this select tag (or the currently selected option in a normal select)
完整的API见http://seleniumhq.github.io/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.select.html#selenium.webdriver.support.select.Select.deselect_by_value