lxml.html.InputGetter

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

# Class InputGetter

source code

    object --+
             |
            InputGetter

An accessor that represents all the input fields in a form.

You can get fields by name from this, with `form.inputs['field_name']`. If there are a set of checkboxes with the same name, they are returned as a list (a CheckboxGroup which also allows value setting). Radio inputs are handled similarly.

You can also iterate over this to get all input elements. This won't return the same thing as if you get all the names, as checkboxes and radio elements are returned individually.

Instance Methods | [hide private]
__init__(self, form) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
__repr__(self) repr(x) | source code
__getitem__(self, name) | source code
__contains__(self, name) | source code
keys(self) | source code
__iter__(self) | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]
| _name_xpath = `.//*[@name = $name and (local-name(.) = 'select'`...``
| _all_xpath = `.//*[local-name() = 'select' or local-name() = 'i`...``

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, form) (Constructor) | source code
x.__init__(...) initializes x; see x.__class__.__doc__ for signature Overrides: object.__init__ (inherited documentation)

### __repr__(self) (Representation operator) | source code
repr(x) Overrides: object.__repr__ (inherited documentation)

Class Variable Details | [hide private]

  ### _name_xpath Value:
      .//*[@name = $name and (local-name(.) = 'select' or local-name(.) = 'i
      nput' or local-name(.) = 'textarea')]

  ### _all_xpath Value:
      .//*[local-name() = 'select' or local-name() = 'input' or local-name()
       = 'textarea']