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.12.0.tar.gz
(188.7 kB
view hashes)
Built Distribution
Close
Hashes for selectorlib-0.12.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ddb83c81fea586c2d6263b2f4c82f279f9077f372b0eb027d567113f524a94d |
|
MD5 | 9cab5ae6f547654fcaa3d4ec3ed41e0b |
|
BLAKE2b-256 | df692e72802ebe4f8d19cf09730b40f23ec80ad136112f19a66ae80ca5307087 |