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.2.tar.gz (2.4 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.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: typed_soup-0.1.2.tar.gz
  • Upload date:
  • Size: 2.4 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.2.tar.gz
Algorithm Hash digest
SHA256 ebc4a7e697dd56053a313c0275ea86fc45b596b0f3b913b3b07241d97ed93c90
MD5 fe155add54faf796c017ffb21db6eab9
BLAKE2b-256 c934ff8a1248c006cb8ebcd753d31c4d29843b430a29715d9ac77ad2af21f408

See more details on using hashes here.

File details

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

File metadata

  • Download URL: typed_soup-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2bb65f6f0b5f45ab1e3f3021386fa500ef5208ba54bbaaad3e2c0829a4307378
MD5 af8acca224a1fab7759896e3566168e7
BLAKE2b-256 27452588f3790933fc9ec72c0d06d4765f4531d0e1d472eb36788f766950d04b

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