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.2.3.tar.gz (144.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.2.3-py3-none-any.whl (169.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: campbells-0.2.3.tar.gz
  • Upload date:
  • Size: 144.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.2.3.tar.gz
Algorithm Hash digest
SHA256 f61aef86d8ca067ef588a714b7209203bdd685a45eefc96805f810274e4d11d4
MD5 fc6dafa2412b2772457ac9c578135415
BLAKE2b-256 1d9e42afafe3c72b04c6684190aa83c27a10edc3978e51f00bfbc41029df9c62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: campbells-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 169.5 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.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8861dffa3aef0316970905f234a6ed37bad6f6f838b986ef0532dc8cb63da40b
MD5 c0865a16c725a7a67b63df3a233f4c7b
BLAKE2b-256 711dc39dd0b03f7b5961b740c2fab9db13162d183ca0a3524e138731db07a981

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