API to extract content from HTML & XML documents
Project description
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
Release history Release notifications | RSS feed
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.11.tar.gz
(3.7 kB
view details)
File details
Details for the file selection-0.0.11.tar.gz
.
File metadata
- Download URL: selection-0.0.11.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e2f5b21bda0c6a877ca42f23f017cb2e95873155fa10ae3ae44520280a9e819 |
|
MD5 | 6b686e635083c9609c21a0bb824ee5a4 |
|
BLAKE2b-256 | 5fe5136ec0c2cb3af11efb9ee45ebba0ec99d53371aab90dc337376ab9b62af6 |