A library to read a YML file with Xpath or CSS Selectors and extract data from HTML pages using them
Project description
selectorlib
A library to read a YML file with Xpath or CSS Selectors and extract data from HTML pages using them
Free software: MIT license
Documentation: https://selectorlib.readthedocs.io.
Example
>>> from selectorlib import Extractor >>> yaml_string = """ title: css: "h1" type: Text link: css: "h2 a" type: Link """ >>> extractor = Extractor.from_yaml_string(yaml_string) >>> html = """ <h1>Title</h1> <h2>Usage <a class="headerlink" href="http://test">¶</a> </h2> """ >>> extractor.extract(html) {'title': 'Title', 'link': 'http://test'}
History
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
selectorlib-0.15.0.tar.gz
(188.8 kB
view hashes)
Built Distribution
Close
Hashes for selectorlib-0.15.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f88288ef0c89043f48045d80e056ab55ada715c26673ae6b3c58dbe0c3e17f47 |
|
MD5 | edf65754ed489e671dc2697144000bd3 |
|
BLAKE2b-256 | 280c81f6cd45139574460585a6effcc276cb37fc0fb55686d095bce3eaab03a9 |