qdyxmas's Room

Done is better than perfect...

selenium select选项

class selenium.webdriver.support.select.Select(webelement)

Bases: object

deselect_all() Clear all selected entries. This is only valid when the SELECT supports multiple selections. throws NotImplementedError If the SELECT does not support multiple selections

deselect_by_index(index) Deselect the option at the given index. This is done by examing the “index” attribute of an element, and not merely by counting.

Args:   
index - The option at this index will be deselected
throws NoSuchElementException If there is no option with specisied index in SELECT

deselect_by_value(value) Deselect all options that have a value matching the argument. That is, when given “foo” this would deselect an option like:

<option value=”foo”>Bar</option>
Args:   
value - The value to match against
throws NoSuchElementException If there is no option with specisied value in SELECT

deselect_by_visible_text(text) Deselect all options that display text matching the argument. That is, when given “Bar” this would deselect an option like:

<option value=”foo”>Bar</option>

Args:   
text - The visible text to match against

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:
index - The option at this index will be selected throws NoSuchElementException If there is no option with specisied index in SELECT

select_by_value(value) 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:   
value - The value to match against
throws NoSuchElementException If there is no option with specisied value in SELECT

select_by_visible_text(text) 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:   
text - The visible text to match against
throws NoSuchElementException If there is no option with specisied text in SELECT

all_selected_options Returns a list of all selected 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)

options Returns a list of all options belonging to this select tag

1 评论

  1. CharlesVex
    /回复

    “I haven’t seen you in these parts,” the barkeep said, sidling over and above to where I sat. “Name’s Bao.” He stated it exuberantly, as if word of his exploits were shared aside settlers about many a verve in Aeternum. He waved to a wooden hogshead apart from us, and I returned his gesticulate with a nod. He filled a telescope and slid it to me across the stained red wood of the excluding first continuing. “As a betting chains, I’d be willing to wager a honourable bit of silver you’re in Ebonscale Reach for more than the swig and sights,” he said, eyes glancing from the sword sheathed on my cool to the capitulate slung across my back. http://maps.google.com.bz/url?q=https://renewworld.ru/new-world-kak-popast-na-alfa-i-beta-testy/

评论