lxml.html.SelectElement

Package lxml :: Package html :: Class SelectElement |
[hide private]
[frames] | no frames]

# Class SelectElement

source code

                object --+
                         |
                InputMixin --+
                             |
        object --+           |
                 |           |
    etree._Element --+       |
                     |       |
     etree.ElementBase --+   |
                         |   |
            object --+   |   |
                     |   |   |
             HtmlMixin --+   |
                         |   |
               HtmlElement --+
                             |
                            SelectElement

`<select>` element. You can get the name with `.name`.

`.value` will be the value of the selected option, unless this is a multi-select element (`<select multiple>`), in which case it will be a set-like object. In either case `.value_options` gives the possible values.

The boolean attribute `.multiple` shows if this is a multi-select.

Instance Methods | [hide private]
_value__get(self) Get/set the value of this select (the selected option). | source code
_value__set(self, value) | source code
_value__del(self) | source code
_multiple__get(self) Boolean attribute: is there a `multiple` attribute on this element. | source code
_multiple__set(self, value) | source code
Inherited from `InputMixin`: `__repr__` Inherited from `InputMixin` (private): `_name__del`, `_name__get`, `_name__set` Inherited from `etree.ElementBase`: `__init__`, `__new__` Inherited from `etree._Element`: `__contains__`, `__copy__`, `__deepcopy__`, `__delitem__`, `__getitem__`, `__iter__`, `__len__`, `__nonzero__`, `__reversed__`, `__setitem__`, `addnext`, `addprevious`, `append`, `clear`, `extend`, `find`, `findall`, `findtext`, `get`, `getchildren`, `getiterator`, `getnext`, `getparent`, `getprevious`, `getroottree`, `index`, `insert`, `items`, `iter`, `iterancestors`, `iterchildren`, `iterdescendants`, `iterfind`, `itersiblings`, `itertext`, `keys`, `makeelement`, `remove`, `replace`, `set`, `values`, `xpath` Inherited from `etree._Element` (private): `_init` Inherited from `HtmlMixin`: `cssselect`, `drop_tag`, `drop_tree`, `find_class`, `find_rel_links`, `get_element_by_id`, `iterlinks`, `make_links_absolute`, `resolve_base_href`, `rewrite_links`, `text_content` Inherited from `HtmlMixin` (private): `_label__del`, `_label__get`, `_label__set` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]
| value Get/set the value of this select (the selected option).
| value_options All the possible values this select can have (the `value` attribute of all the `<option>` elements.
| multiple Boolean attribute: is there a `multiple` attribute on this element.
Inherited from `InputMixin`: `name` Inherited from `etree._Element`: `attrib`, `base`, `nsmap`, `prefix`, `sourceline`, `tag`, `tail`, `text` Inherited from `HtmlMixin`: `base_url`, `body`, `forms`, `head`, `label` Inherited from `object`: `__class__`

Method Details | [hide private]

### _value__get(self) | source code
Get/set the value of this select (the selected option). If this is a multi-select, this is a set-like object that represents all the selected options.

Property Details | [hide private]

### value Get/set the value of this select (the selected option). If this is a multi-select, this is a set-like object that represents all the selected options. Get Method: _value__get(self) - Get/set the value of this select (the selected option). Set Method: _value__set(self, value) Delete Method: _value__del(self)

### value_options All the possible values this select can have (the `value` attribute of all the `<option>` elements. Get Method: unreachable.value_options(self) - All the possible values this select can have (the `value` attribute of all the `<option>` elements.

### multiple Boolean attribute: is there a `multiple` attribute on this element. Get Method: _multiple__get(self) - Boolean attribute: is there a `multiple` attribute on this element. Set Method: _multiple__set(self, value)