The elementtree.ElementPath Module

Implementation module for XPath support. There's usually no reason to import this module directly; the ElementTree does this for you, if needed.

Module Contents

_compile(path) [#]

(Internal) Compile path.

find(element, path) [#]

Find first matching object.

findall(element, path) [#]

Find all matching objects.

findtext(element, path, default=None) [#]

Find text for first matching object.

Path(path) (class) [#]

Wrapper for a compiled XPath.

For more information about this class, see The Path Class.

The Path Class

Path(path) (class) [#]

Wrapper for a compiled XPath.

__init__(path) [#]

Create an Path instance from an XPath expression.

find(element) [#]

Find first matching object.

findall(element) [#]

Find all matching objects.

findtext(element, default=None) [#]

Find text for first matching object.