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
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file selectorlib-0.11.0.tar.gz.
File metadata
- Download URL: selectorlib-0.11.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using 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.1 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43f3bf8003d5cb160e7c86b5f3d5be5f35b5d68427ad3103bbafdbc1a3b775db
|
|
| MD5 |
e6a481b7e184178c88c5414a1b438da4
|
|
| BLAKE2b-256 |
61f1841a75af19d2556f7519746efb1cdac1b99665f7c2deaa46fcb0ed239e73
|
File details
Details for the file selectorlib-0.11.0-py2.py3-none-any.whl.
File metadata
- Download URL: selectorlib-0.11.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 2, Python 3
- Uploaded using 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.1 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9053b2d8c8db793db522b7b599910dee7723fbeff2cb85941630af3858fdefa0
|
|
| MD5 |
10a37f32034f26bae2727ff52cc0aea5
|
|
| BLAKE2b-256 |
5224949ec3919d77468884a03469bb7cbeb3d38196d235df26945eae3dfb1de8
|