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
Release files for selectorlib 0.16.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| selectorlib-0.16.0.tar.gz | 188.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| selectorlib-0.16.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 194.7 kB
Release files / selectorlib-0.16.0.tar.gz
| Download URL | selectorlib-0.16.0.tar.gz |
|---|---|
| Size | 188.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
154f7c5f39bc825a0717b24ca2cc0b95dcb2caa1669239f3d4ac6e41af398731
|
|
BLAKE2b-256 checksum How to use checksums |
0057f1ae8c2740980eec4a142fd8b1f6603294bba079add5e29bf62f51503c96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.1
|
Release files / selectorlib-0.16.0-py2.py3-none-any.whl
| Download URL | selectorlib-0.16.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
007c156d01ab8de86f72f0914d66d704f6fb4ebda0db0e04f204083d63e55bc6
|
|
BLAKE2b-256 checksum How to use checksums |
1e3e7ad0a01b07c066cf79c431324970869345e4d249242d70f20e939a5c630b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.1
|