lxml :: html :: HtmlElementClassLookup :: Class HtmlElementClassLookup

[hide private]
[frames] | no frames]

# Class HtmlElementClassLookup

source code

                      object --+
                               |
        etree.ElementClassLookup --+
                                   |
    etree.FallbackElementClassLookup --+
                                       |
          etree.CustomElementClassLookup --+
                                           |
                                          HtmlElementClassLookup

A lookup scheme for HTML Element classes.

To create a lookup instance with different Element classes, pass a tag name mapping of Element classes in the `classes` keyword argument and/or a tag name mapping of Mixin classes in the `mixins` keyword argument. The special key '*' denotes a Mixin class that should be mixed into all Element classes.

Instance Methods | [hide private]

__init__(self, classes=None, mixins=None) x.__init__(...) initializes x; see help(type(x)) for signature | source code

lookup(self, node_type, document, namespace, name) | source code

Inherited from `etree.CustomElementClassLookup`: `__new__` Inherited from `etree.FallbackElementClassLookup`: `set_fallback` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]

| _default_element_classes = ``{``'``form``'``:` <class 'lxml.html.FormElem`...``

Properties | [hide private]

Inherited from `etree.FallbackElementClassLookup`: `fallback` Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, classes=None, mixins=None)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
  (inherited documentation)

### lookup(self, node_type, document, namespace, name)

source code

Overrides: etree.CustomElementClassLookup.lookup
  (inherited documentation)

Class Variable Details | [hide private]

### _default_element_classes

Value:

      {'form': <class 'lxml.html.FormElement'>,
       'input': <class 'lxml.html.InputElement'>,
       'label': <class 'lxml.html.LabelElement'>,
       'select': <class 'lxml.html.SelectElement'>,
       'textarea': <class 'lxml.html.TextareaElement'>}