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 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.7.tar.gz (6.3 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for selection-0.0.7.tar.gz
Algorithm Hash digest
SHA256 ec68c85bb9c0a6b2c93ee63c7186cbc574a5d058e58e9876a959e83c3bd27857
MD5 520ec267096b496ef0edad6fd4c1c81b
BLAKE2b-256 c6a27d39b047d6caf5f3df1fb1f3bbed3cac24e6225ea6006c25e0d9302d4b7b

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