Skip to main content
2025 Python Packaging Survey is now live!  Take the survey now

Parsley extraction library using lxml

Project description

Parslepy lets you extract content from HTML and XML documents where extraction rules are defined using a JSON object or equivalent Python dict, where keys are names you want to assign to extracted content, and values are CSS selectors or XPath expressions.

Parslepy is an implementation of the Parsley extraction language defined here https://github.com/fizx/parsley, using lxml and cssselect.

You can nest objects, generate list of objects, and (to a certain extent) mix CSS and XPath.

Parslepy uderstands what lxml and cssselect understand, which is roughly CSS 3 and XPath 1

Documentation & examples

See https://github.com/redapple/parslepy/wiki#usage

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page