woob.browser.elements
¶
- class AbstractElement(*args, **kwargs)[source]¶
Bases:
object
- condition = None¶
The condition to parse the element.
This allows ignoring certain elements if certain fields are not valid, or if the element should actually be parsed using another class.
This property can be defined as:
None or True, to signify that the element should be parsed regardless.
False, to signify that the element should not be parsed regardless.
A filter returning a falsy or non-falsy object, evaluated with the constructed document section (HTML element or JSON data) for the element.
A method returning a falsy or non-falsy object, evaluated with the element object directly.
- class ListElement(*args, **kwargs)[source]¶
Bases:
AbstractElement
- item_xpath = None¶
- empty_xpath = None¶
- flush_at_end = False¶
- ignore_duplicate = False¶
- class ItemElement(*args, **kwargs)[source]¶
Bases:
AbstractElement
- klass = None¶
- validate = None¶
- skip_optional_fields_errors = False¶
- class TableElement(*args, **kwargs)[source]¶
Bases:
ListElement
- head_xpath = None¶
- exception SkipItem[source]¶
Bases:
Exception
Raise this exception in an
ItemElement
subclass to skip an item.