Skip to main content

Declarative Scraping Tools

Project description

LST

Declarative Scraping Tools

Fetch - get content (requests library)

Scan - select tags by css selector (bs4 library)

Example

from lst import Fetch, Scan

parser = Fetch() >> Scan('a') >> Fetch() >> {'h1': Scan('h1'), 'h5': Scan('h5')}

for res in parser('http://some.site'):
    if 'h1' in res:
        tag = res['h1']
        print('H1', tag.get_text())
    if 'h5' in res:
        tag = res['h5']
        print('H5', tag.get_text())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

lst-0.4.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file lst-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: lst-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for lst-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26ffaf26383ebed2c60d7818bfcbc3353b60f20296d0b6eb01e7d829268a9dda
MD5 8530b4143225117cb276ca84b3c9d440
BLAKE2b-256 a26bfdc8a482be58c0ac2dfdc3b1362ff14612c61318811daf61b7d8cdc0a6f4

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 Pingdom Monitoring Sentry Error logging StatusPage Status page