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
_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__` 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__`, `__getattribute__`, `__hash__`, `__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`, `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 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: _value__get(self) - Get/set the value of this element, using the `value` attribute. Set Method: _value__set(self, value) Delete Method: _value__del(self)

### type Return the type of this element (using the type attribute). Get Method: _type__get(self) - Return the type of this element (using the type attribute). Set Method: _type__set(self, value)

### checkable Boolean: can this element be checked? Get Method: unreachable.checkable(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: _checked__get(self) - Boolean attribute to get/set the presence of the `checked` attribute. Set Method: _checked__set(self, value)