lxml.html.SelectElement
lxml :: html :: SelectElement :: 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]

Inherited from InputMixin: __repr__

Inherited from HtmlElement: cssselect, 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, values, xpath

Inherited from etree._Element (private): _init

Inherited from HtmlMixin: 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 object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  multiple
Boolean attribute: is there a multiple attribute on this element.
  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.

Inherited from InputMixin: name

Inherited from etree._Element: attrib, base, nsmap, prefix, sourceline, tag, tail, text

Inherited from HtmlMixin: base_url, body, classes, forms, head, label

Inherited from object: __class__

Property Details [hide private]

multiple

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

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:
unreachable.value(self) - Get/set the value of this select (the selected option).
Set Method:
unreachable.value(self, value)
Delete Method:
unreachable.value(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.