Skip to main content

API to extract content from HTML & XML documents

Project description

Selection Documenation

Tests Code Quality Typing Test coverage

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


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

Uploaded Source

File details

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

File metadata

  • Download URL: selection-0.0.21.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for selection-0.0.21.tar.gz
Algorithm Hash digest
SHA256 a136018db3fca4ef05ff420dd41a27789b268375aa2b17a8077faa68e671aa6d
MD5 758abfc3f1a5149f9702000e58fd7084
BLAKE2b-256 2fccab4159f789d60e2b7bd02a72cc728d06cbb3b3ecc8a851e992a00347c7a5

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