Skip to main content

API to extract content from HTML & XML documents

Project description

https://travis-ci.org/lorien/selection.png?branch=master https://coveralls.io/repos/lorien/selection/badge.svg?branch=master https://pypip.in/download/selection/badge.svg?period=month https://pypip.in/version/selection/badge.svg https://landscape.io/github/lorien/selection/master/landscape.png

API to extract data from HTML and XML documents.

Usage Example

Example:

from selection import XpathSelector
from lxml.html import fromstring

html = '<div><h1>test</h1><ul id="items"><li>1</li><li>2</li></ul></div>'
sel = XpathSelector(fromstring(html))
print(sel.select('//h1')).text()
print(sel.select('//li').text_list()
print(sel.select('//ul').attr('id')

Installation

Run:

pip install -U selection

Dependencies

  • lxml

  • tools

  • six

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

selection-0.0.10.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file selection-0.0.10.tar.gz.

File metadata

  • Download URL: selection-0.0.10.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for selection-0.0.10.tar.gz
Algorithm Hash digest
SHA256 efebb9518bb391a819a9d73753487271ac4e23dec70387770d6b2d686bc92c43
MD5 1269a87d5176c6524c0fed156289b712
BLAKE2b-256 e9eab55ce307a12757803e1c26440213a3003954f7cef96754a940ae9707346b

See more details on using hashes here.

Supported by

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