HTMLDocument

Overview

HTMLDocument is a class in Aspose.Html FOSS for Python.

Top-level entry point for parsing HTML into a Document tree.

This class provides 3 methods for working with HTMLDocument objects in Python programs. Available methods include: load, parse, parse_fragment. All public members are accessible to any Python application after installing the Aspose.Html FOSS for Python package.

Methods

SignatureDescription
parse(html: str | bytes, encoding: str | None, base_url: str | None)"Document"Parse HTML and return a Document tree.
parse_fragment(html: str | bytes, context_element: "Element | None", encoding: str | None)"DocumentFragment"Parse an HTML fragment and return a DocumentFragment.
load(path: "str | pathlib.Path")"Document"Load an HTML document from a file path and return a Document tree.

See Also