Skip to main content

A condensed web scraping library.

Project description

Campbells 🥫

A condensed web scraping library.

InstallExamples

Adapted from beautifulsoup4's inner package, then linted, refactored, reduced, and seasoned to taste.

Development

To run pre-commit checks and tests:

pre-commit run --all-files && pdm run python -m pytest

Examples

To parse a string as HTML, your reciple should call for CampbellsSoup:

from campbells import CampbellsSoup

html_str = "<html><body><p>Hello world!</p></body></html>"
soup = CampbellsSoup(html_str)

Installation

Campbells is available on PyPi:

pip install campbells

The dependencies needed to use html5lib and lxml parsers are not installed by default. They can be installed with:

  • pip install campbells[html5lib] to be able to use html5lib.
    • Pros: closest to how browsers parses web pages, very lenient, creates valid HTML5.
    • Cons: slowest parser.
  • pip install campbells[lxml] to be able to use lxml.
    • Pros: fastest parser.
    • Cons: heavier dependency (C extension).

Project details


Download files

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

Source Distribution

campbells-0.3.0.tar.gz (145.3 kB view details)

Uploaded Source

Built Distribution

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

campbells-0.3.0-py3-none-any.whl (173.4 kB view details)

Uploaded Python 3

File details

Details for the file campbells-0.3.0.tar.gz.

File metadata

  • Download URL: campbells-0.3.0.tar.gz
  • Upload date:
  • Size: 145.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.8.2 CPython/3.10.6

File hashes

Hashes for campbells-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b0c2e4d47e8f9eed71fbe1b44daacb7d950bdca877341b22dfe2aee3d3891654
MD5 71b3ae25abdc425069b897fe5feb5a1b
BLAKE2b-256 22d0319df779ad1fb74df055066ea003cc0e595a9a6bcb48eff60594067bc0a2

See more details on using hashes here.

File details

Details for the file campbells-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: campbells-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 173.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.8.2 CPython/3.10.6

File hashes

Hashes for campbells-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40b3bf04eb7ca46621b03b6c06329ce778344ecbdd484885b8f4ff2f178ffa8c
MD5 f4ae49a5e31e964bf9771180423e0820
BLAKE2b-256 90370d08f0064ce7a627ae97bafe39af3774fd45f5952bf65414613f3d7c9429

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