Skip to main content

selectorlib

https://img.shields.io/pypi/v/selectorlib.svg https://img.shields.io/travis/scrapehero/selectorlib.svg Documentation Status Updates

A library to read a YML file with Xpath or CSS Selectors and extract data from HTML pages using them

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

selectorlib-0.11.0-py2.py3-none-any.whl (5.8 kB view details)

Uploaded Python 2Python 3

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

Hashes for selectorlib-0.11.0.tar.gz
Algorithm Hash digest
SHA256 43f3bf8003d5cb160e7c86b5f3d5be5f35b5d68427ad3103bbafdbc1a3b775db
MD5 e6a481b7e184178c88c5414a1b438da4
BLAKE2b-256 61f1841a75af19d2556f7519746efb1cdac1b99665f7c2deaa46fcb0ed239e73

See more details on using hashes here.

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

Hashes for selectorlib-0.11.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9053b2d8c8db793db522b7b599910dee7723fbeff2cb85941630af3858fdefa0
MD5 10a37f32034f26bae2727ff52cc0aea5
BLAKE2b-256 5224949ec3919d77468884a03469bb7cbeb3d38196d235df26945eae3dfb1de8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page