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.11.0.tar.gz
(16.8 kB
view hashes)
Built Distribution
Close
Hashes for selectorlib-0.11.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9053b2d8c8db793db522b7b599910dee7723fbeff2cb85941630af3858fdefa0 |
|
MD5 | 10a37f32034f26bae2727ff52cc0aea5 |
|
BLAKE2b-256 | 5224949ec3919d77468884a03469bb7cbeb3d38196d235df26945eae3dfb1de8 |