Skip to main content

A type-safe wrapper around BeautifulSoup and related HTML parsing utilities

Project description

typed-soup

A type-safe wrapper around BeautifulSoup and utilities for parsing HTML/XML with robust return types and error handling.

Installation

pip install typed-soup

Usage

from typed_soup import from_response
from scrapy.http.response.html import HtmlResponse

# Assume 'response' is an HtmlResponse object
soup = from_response(response)

# Find an element
element = soup.find("div", class_="example")
if element:
    print(element.get_text())

# Find all elements
elements = soup.find_all("p")
for elem in elements:
    print(elem.get_text())

License

This project is licensed under the MIT License.

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

typed_soup-0.1.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

typed_soup-0.1.1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file typed_soup-0.1.1.tar.gz.

File metadata

  • Download URL: typed_soup-0.1.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/24.4.0

File hashes

Hashes for typed_soup-0.1.1.tar.gz
Algorithm Hash digest
SHA256 396b65c8601c5303e4043a0cd2b6a5b322ea249fe496644c9edb79d7ce288453
MD5 701e24a1379bb4043bd64853cbdf910a
BLAKE2b-256 08e05f958e7e9c8bda090800b5769c4f62dd89f52710139b78c3d92445ef2fee

See more details on using hashes here.

File details

Details for the file typed_soup-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: typed_soup-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/24.4.0

File hashes

Hashes for typed_soup-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c7ee035af6984fce0add09bfdb4dd62c7dbfc68b9f6940954ba3910be65a9ba
MD5 71abc1de3544aaec605a629d3be06491
BLAKE2b-256 b4d1bbd9e28992258687cd04f41d08437cf7e0b6847397405a70a61fbf0e6324

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