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.16.0.tar.gz
(188.8 kB
view hashes)
Built Distribution
Close
Hashes for selectorlib-0.16.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 007c156d01ab8de86f72f0914d66d704f6fb4ebda0db0e04f204083d63e55bc6 |
|
MD5 | 8aa1a3ca4568c3d278192b6d8766f1e9 |
|
BLAKE2b-256 | 1e3e7ad0a01b07c066cf79c431324970869345e4d249242d70f20e939a5c630b |