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 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.7.tar.gz
(6.3 kB
view details)
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec68c85bb9c0a6b2c93ee63c7186cbc574a5d058e58e9876a959e83c3bd27857 |
|
MD5 | 520ec267096b496ef0edad6fd4c1c81b |
|
BLAKE2b-256 | c6a27d39b047d6caf5f3df1fb1f3bbed3cac24e6225ea6006c25e0d9302d4b7b |