Cheshire3 Object Model - Selector

API

class cheshire3.baseObjects.Selector(session, config, parent=None)[source]

A Selector is a simple wrapper around a means of selecting data.

This could be an XPath or some other means of selecting data from the parsed structure in a Record.

process_record(session, record)[source]

Process the given Record and return the results.

Implementations

The following implementations are included in the distribution by default:

class cheshire3.selector.XPathSelector(session, config, parent)[source]

Selects data specified by XPath(s) from Records.

class cheshire3.selector.TransformerSelector(session, config, parent)[source]

Selector that applies a Transformer to the Record to select data.

class cheshire3.selector.MetadataSelector(session, config, parent)[source]

Selector specifying and attribute or function.

Selector that specifies an attribute or function to use to select data from Records.

class cheshire3.selector.SpanXPathSelector(session, config, parent)[source]

Selects data from between two given XPaths.

Requires exactly two XPaths. The span starts at first configured XPath and ends at the second. The same XPath may be given as both start and end point, in which case each matching element acts as a start and stop point (e.g. an XPath for a page break).