API to extract content from HTML & XML documents
Project description
Selection Documenation
API to query DOM tree of HTML/XML document.
Usage 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
Community
Telegram English chat: https://t.me/grablab
Telegram Russian chat: https://t.me/grablab_ru
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.16.tar.gz
(8.8 kB
view details)
File details
Details for the file selection-0.0.16.tar.gz
.
File metadata
- Download URL: selection-0.0.16.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc4b679b0da8b0c1f823638cff76eac006d6f955b8fb6ed470a8e435638f852c |
|
MD5 | 406fadfd75263b611ddb2b5f6c6597d2 |
|
BLAKE2b-256 | 92fbc5af0d34ec115887a106d4c9675b29ca71a84a84646dfdfc947a5449bfbd |