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.12.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.12.0.tar.gz | 188.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| selectorlib-0.12.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 194.5 kB
Release files / selectorlib-0.12.0.tar.gz
| Download URL | selectorlib-0.12.0.tar.gz |
|---|---|
| Size | 188.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7cc3d4a5ed31700c32ffa8e5a5c24b8c3c143f1938550e1420eae016875d96f
|
|
BLAKE2b-256 checksum How to use checksums |
7f7538cc8f9840350e9a9953a287bcc0b3d65c8b0c72aaaf8d0d38cb2b5ec1e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1
|
Release files / selectorlib-0.12.0-py2.py3-none-any.whl
| Download URL | selectorlib-0.12.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
6ddb83c81fea586c2d6263b2f4c82f279f9077f372b0eb027d567113f524a94d
|
|
BLAKE2b-256 checksum How to use checksums |
df692e72802ebe4f8d19cf09730b40f23ec80ad136112f19a66ae80ca5307087
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1
|