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

Class InputElement

source code

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

Represents an ``<input>`` element.

You can get the type with ``.type`` (which is lower-cased and defaults to ``'text'``).

Also you can get and set the value with ``.value``

Checkboxes and radios have the attribute ``input.checkable == True`` (for all others it is false) and a boolean attribute ``.checked``.

Instance Methods [hide private]
 
value__get(self)
Get/set the value of this element, using the ``value`` attribute.
source code
 
value__set(self, value) source code
 
value__del(self) source code
 
type__get(self)
Return the type of this element (using the type attribute).
source code
 
type__set(self, value) source code
 
checkable__get(self)
Boolean: can this element be checked?
source code
 
checked__get(self)
Boolean attribute to get/set the presence of the ``checked`` attribute.
source code
 
checked__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 element, using the ``value`` attribute.
  type
Return the type of this element (using the type attribute).
  checkable
Boolean: can this element be checked?
  checked
Boolean attribute to get/set the presence of the ``checked`` attribute.

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 element, using the ``value`` attribute.

Also, if this is a checkbox and it has no value, this defaults to ``'on'``. If it is a checkbox or radio that is not checked, this returns None.

checked__get(self)

source code 

Boolean attribute to get/set the presence of the ``checked`` attribute.

You can only use this on checkable input types.

Property Details [hide private]

value

Get/set the value of this element, using the ``value`` attribute.

Also, if this is a checkbox and it has no value, this defaults to ``'on'``. If it is a checkbox or radio that is not checked, this returns None.
Get Method:
lxml.html.InputElement.value__get(self) - Get/set the value of this element, using the ``value`` attribute.
Set Method:
lxml.html.InputElement.value__set(self, value)
Delete Method:
lxml.html.InputElement.value__del(self)

type

Return the type of this element (using the type attribute).
Get Method:
lxml.html.InputElement.type__get(self) - Return the type of this element (using the type attribute).
Set Method:
lxml.html.InputElement.type__set(self, value)

checkable

Boolean: can this element be checked?
Get Method:
lxml.html.InputElement.checkable__get(self) - Boolean: can this element be checked?

checked

Boolean attribute to get/set the presence of the ``checked`` attribute.

You can only use this on checkable input types.
Get Method:
lxml.html.InputElement.checked__get(self) - Boolean attribute to get/set the presence of the ``checked`` attribute.
Set Method:
lxml.html.InputElement.checked__set(self, value)