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.0.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.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: typed_soup-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 37a17aafe3dcf17c26eb2fbd1e7771ee466a47dd1fa60a5de761932a766c9b54
MD5 db3511b37372e2c201494673d4f3fa67
BLAKE2b-256 9f7bd4582da80d0c82825d791026f1f08d1c46c0dc1b833ad8a02052c48f2bc4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: typed_soup-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f949241ef33b74211c57e4989e3258cc8c17e7f87d85591fceee7e35113bf4f0
MD5 7fbf697fd362796b7f398367db32be8a
BLAKE2b-256 0b577ba8b4e43cb3982a38c187bb5c59e5d1f5219e723aa9e2a758b76541d4aa

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