Features Overview
Features Overview
Aspose.HTML FOSS for Python is organised into focused capability areas, each with its own guide. This page maps what the library covers and where each entry point lives.
Document Object Model
The Document, Element, and Node classes implement standards-based tree construction and manipulation: node factories, attribute management, traversal, MutationObserver, Range, and iteration via NodeIterator and TreeWalker. See the DOM guide.
HTML Documents and Elements
HTMLDocument.parse() and parse_fragment() turn markup into trees, and typed element classes — HTMLElement, HTMLAnchorElement, HTMLInputElement, HTMLFormElement, and dozens more — model element-specific behaviour. See the HTML guide.
CSSOM and Computed Styles
CSSStyleSheet, the CSSStyleRule family (media, keyframes, font-face, supports, import rules), and CSSStyleDeclaration implement the CSS object model; Element.get_computed_style() resolves the cascade. See the CSSOM guide.
Selector Engine
select() and element_matches() run CSS selectors against the tree, backed by parsed SelectorList structures with full specificity computation via specificity(). See the CSS selectors guide.
Layout Engine
build_box_tree() and layout_block_tree() produce box trees and layout fragments — BlockFragment, LineFragment, PageFragment — with pagination via paginate_fragments(). See the Layout guide.
Tokenizer
The Tokenizer emits standards-defined tokens (StartTagToken, EndTagToken, CharacterToken, DoctypeToken, CommentToken, EofToken) with full character-reference resolution. See the Tokenizer guide.
Tree Construction
TreeBuilder implements the standards tree-construction algorithm — insertion modes, the adoption agency algorithm, quirks-mode detection, and foreign-content handling — with parse_html() as the one-call entry point. See the Tree construction guide.
JavaScript Context
JSContext provides a scripting context with module loading governed by ModuleRegistry and ModuleLoadPolicy. See the JavaScript guide.
URLs
URL.parse(), URL.can_parse(), and URLSearchParams implement WHATWG-style URL parsing and query-string handling. See the URL guide.
Encoding Detection
detect_encoding() sniffs byte streams (BOM and meta prescan), decode_bytes() decodes them, and get_canonical_name() normalizes encoding labels. See the Encoding guide.
Window and Runtime Environment
Window, Navigator, Location, History, Storage, and the Event/EventTarget family model the browsing environment for scenarios that need one, without a browser. See the Core runtime guide.
API Reference Summary
| Area | Entry points |
|---|---|
| DOM | Document, Element, Node, MutationObserver |
| HTML | HTMLDocument, HTMLElement |
| CSSOM | CSSStyleSheet, CSSStyleDeclaration, Element.get_computed_style |
| Selectors | select, element_matches, SelectorList |
| Layout | build_box_tree, layout_block_tree, paginate_fragments |
| Tokenizer | Tokenizer, TokenizerState |
| Tree | TreeBuilder, parse_html, parse_fragment |
| JavaScript | JSContext, ModuleRegistry |
| URL | URL, URLSearchParams |
| Encoding | detect_encoding, decode_bytes, get_canonical_name |
| Runtime | Window, EventTarget, History |