lxml.etree.HTMLPullParser

Package lxml :: Module etree :: Class HTMLPullParser |
[hide private]
[frames] | no frames]

# Class HTMLPullParser

        object --+
                 |
    ??._BaseParser --+
                     |
           _FeedParser --+
                         |
                HTMLParser --+
                             |
                            HTMLPullParser

HTMLPullParser(self, events=None, *, tag=None, base_url=None, **kwargs)

HTML parser that collects parse events in an iterator.

The collected events are the same as for iterparse(), but the parser itself is non-blocking in the sense that it receives data chunks incrementally through its .feed() method, instead of reading them directly from a file(-like) object all by itself.

By default, it collects Element end events. To change that, pass any subset of the available events into the `events` argument: `'start'`, `'end'`, `'start-ns'`, `'end-ns'`, `'comment'`, `'pi'`.

To support loading external dependencies relative to the input source, you can pass the `base_url`.

Instance Methods | [hide private]
__init__(self, events=None, tag=None, base_url=None, *, **kwargs) x.__init__(...) initializes x; see help(type(x)) for signature |
a new object with type S, a subtype of T |
__new__(T, S, ...) |
read_events(...) |
Inherited from `_FeedParser`: `close`, `feed` Inherited from `unreachable._BaseParser`: `copy`, `makeelement`, `setElementClassLookup`, `set_element_class_lookup` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]
Inherited from `_FeedParser`: `feed_error_log` Inherited from `unreachable._BaseParser`: `error_log`, `resolvers`, `target`, `version` Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, events=None, tag=None, base_url=None, *, **kwargs) (Constructor) |
x.__init__(...) initializes x; see help(type(x)) for signature Overrides: object.__init__

### __new__(T, S, ...) |
Returns: a new object with type S, a subtype of T Overrides: object.__new__