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__, name__del, name__get, name__set

Inherited from etree.ElementBase: __new__

Inherited from etree._Element: __contains__, __copy__, __deepcopy__, __delitem__, __delslice__, __getitem__, __getslice__, __iter__, __len__, __nonzero__, __reversed__, __setitem__, __setslice__, 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, label__del, label__get, label__set, make_links_absolute, resolve_base_href, rewrite_links, text_content

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __setattr__, __str__

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, 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:
lxml.html.SelectElement.value__get(self) - Get/set the value of this select (the selected option).
Set Method:
lxml.html.SelectElement.value__set(self, value)
Delete Method:
lxml.html.SelectElement.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:
lxml.html.SelectElement.multiple__get(self) - Boolean attribute: is there a ``multiple`` attribute on this element.
Set Method:
lxml.html.SelectElement.multiple__set(self, value)