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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size selectorlib-0.14.0-py2.py3-none-any.whl (5.8 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes View |
Filename, size selectorlib-0.14.0.tar.gz (188.8 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for selectorlib-0.14.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a7965e5666502454d3092ac3cb07a990dca30b1ae6229cf1d2348482072e22f |
|
MD5 | 03a44f925468b082ec68b7e41a70e6a1 |
|
BLAKE2-256 | 4a7459b32e13cd71096156e29e8c1748913deff03d67b2708d5efc407a226425 |