abc – Abstract Base Classes.

class data_extractor.abc.ComplexExtractorMeta(name: str, bases: Tuple[type], attr_dict: Dict[str, Any])

Complex Extractor Meta Class.

class data_extractor.abc.AbstractExtractor(expr: str)

All Extractors’ Abstract Base Clase.

Parameters

expr – Extractor selector expression.

extract(element: Any) → Any

Extract data or subelement from element.

Parameters

element – The target data node element.

Returns

Data or subelement.

class data_extractor.abc.SimpleExtractorBase(expr: str)

Simple Extractor Base Class.

Parameters

expr – extractor selector expression.

extract(element: Any) → Any

Extract data or subelement from element.

Parameters

element – The target data node element.

Returns

Data or subelement.

extract_first(element: Any, default: Any = sentinel) → Any

Extract the first data or subelement from extract method call result.

Parameters
Returns

Data or subelement.

Raises

data_extractor.exceptions.ExtractError – Thrown by extractor extracting wrong data.