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

Type SelectElement

object --+            
         |            
  _Element --+        
             |        
   ElementBase --+    
                 |    
    object --+   |    
             |   |    
     HtmlMixin --+    
                 |    
       HtmlElement --+
                     |
        object --+   |
                 |   |
        InputMixin --+
                     |
                    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.
Method Summary
  multiple__get(self)
Boolean attribute: is there a ``multiple`` attribute on this element.
  multiple__set(self, value)
  value__del(self)
  value__get(self)
Get/set the value of this select (the selected option).
  value__set(self, value)
    Inherited from InputMixin
  __repr__(self)
  name__del(self)
  name__get(self)
Get/set the name of the element
  name__set(self, value)
    Inherited from ElementBase
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
    Inherited from _Element
  __contains__(x, y)
x.__contains__(y) <==> y in x
  __copy__(...)
  __deepcopy__(...)
  __delitem__(x, y)
x.__delitem__(y) <==> del x[y]
  __delslice__(x, i, j)
Use of negative indices is not supported.
  __getitem__(x, y)
x.__getitem__(y) <==> x[y]
  __getslice__(x, i, j)
Use of negative indices is not supported.
  __iter__(x)
x.__iter__() <==> iter(x)
  __len__(x)
x.__len__() <==> len(x)
  __nonzero__(x)
x.__nonzero__() <==> x != 0
  __reversed__(...)
  __setitem__(x, i, y)
x.__setitem__(i, y) <==> x[i]=y
  __setslice__(x, i, j, y)
Use of negative indices is not supported.
  _init(...)
Called after object initialisation.
  addnext(...)
Adds the element as a following sibling directly after this element.
  addprevious(...)
Adds the element as a preceding sibling directly before this element.
  append(...)
Adds a subelement to the end of this element.
  clear(...)
Resets an element.
  extend(...)
Extends the current children by the elements in the iterable.
  find(...)
Finds the first matching subelement, by tag name or path.
  findall(...)
Finds all matching subelements, by tag name or path.
  findtext(...)
Finds text for the first matching subelement, by tag name or path.
  get(...)
Gets an element attribute.
  getchildren(...)
Returns all subelements.
  getiterator(...)
Iterate over all elements in the subtree in document order (depth first pre-order), starting with this element.
  getnext(...)
Returns the following sibling of this element or None.
  getparent(...)
Returns the parent of this element or None for the root element.
  getprevious(...)
Returns the preceding sibling of this element or None.
  getroottree(...)
Return an ElementTree for the root node of the document that contains this element.
  index(...)
Find the position of the child within the parent.
  insert(...)
Inserts a subelement at the given position in this element
  items(...)
Gets element attributes, as a sequence.
  iter(...)
Iterate over all elements in the subtree in document order (depth first pre-order), starting with this element.
  iterancestors(...)
Iterate over the ancestors of this element (from parent to parent).
  iterchildren(...)
Iterate over the children of this element.
  iterdescendants(...)
Iterate over the descendants of this element in document order.
  itersiblings(...)
Iterate over the following or preceding siblings of this element.
  keys(...)
Gets a list of attribute names.
  makeelement(...)
Creates a new element associated with the same document.
  remove(...)
Removes a matching subelement.
  replace(...)
Replaces a subelement with the element passed as second argument.
  set(...)
Sets an element attribute.
  values(...)
Gets element attribute values as a sequence of strings.
  xpath(...)
Evaluate an xpath expression using the element as context node.
    Inherited from HtmlMixin
  cssselect(self, expr)
Run the CSS expression on this element and its children, returning a list of the results.
  drop_tag(self)
Remove the tag, but not its children or text.
  drop_tree(self)
Removes this element from the tree, including its children and text.
  find_class(self, class_name)
Find any elements with the given class name.
  find_rel_links(self, rel)
Find any links like ``<a rel="{rel}">...</a>``; returns a list of elements.
  get_element_by_id(self, id, *default)
Get the first element in a document with the given id.
  iterlinks(self)
Yield (element, attribute, link, pos), where attribute may be None (indicating the link is in the text).
  label__del(self)
  label__get(self)
Get or set any <label> element associated with this element.
  label__set(self, label)
  make_links_absolute(self, base_url, resolve_base_href)
Make all links in the document absolute, given the ``base_url`` for the document (the full URL where the document came from), or if no ``base_url`` is given, then the ``.base_url`` of the document.
  resolve_base_href(self)
Find any ``<base href>`` tag in the document, and apply its values to all links found in the document.
  rewrite_links(self, link_repl_func, resolve_base_href, base_href)
Rewrite all the links in the document.
  text_content(self)
Return the text content of the tag (and the text in any children).
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Property Summary
  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: Get/set the name of the element
    Inherited from HtmlMixin
  base_url: Returns the base URL, given when the page was parsed.
  body: Return the <body> element.
  forms: Return a list of all the forms
  head: Returns the <head> element.
  label: Get or set any <label> element associated with this element.

Class Variable Summary
    Inherited from _Element
getset_descriptor attrib = <attribute 'attrib' of 'lxml.etree._Element' ob...
getset_descriptor nsmap = <attribute 'nsmap' of 'lxml.etree._Element' obje...
getset_descriptor prefix = <attribute 'prefix' of 'lxml.etree._Element' ob...
getset_descriptor sourceline = <attribute 'sourceline' of 'lxml.etree._Ele...
getset_descriptor tag = <attribute 'tag' of 'lxml.etree._Element' objects>
getset_descriptor tail = <attribute 'tail' of 'lxml.etree._Element' object...
getset_descriptor text = <attribute 'text' of 'lxml.etree._Element' object...

Method Details

multiple__get(self)

Boolean attribute: is there a ``multiple`` attribute on this element.

value__get(self)

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

multiple

Boolean attribute: is there a ``multiple`` attribute on this element.
Get Method:
multiple__get(self)
Set Method:
multiple__set(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:
value__get(self)
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:
value_options(...)

Generated by Epydoc 2.1 on Sat Aug 18 12:44:27 2007 http://epydoc.sf.net