Resiliparse is a collection of robust and fast processing tools for parsing and analyzing web archive data, encompassing utilities for character encoding, HTML parsing, content extraction, and process guarding. It is currently at version 0.16.0 and is actively maintained as part of the ChatNoir web analytics toolkit.
pip install resiliparseVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates parsing HTML from both Unicode strings and byte strings with encoding detection, and then performing basic DOM selection to extract information.
Re-obtain or re-query `DOMNode` instances after any modification to the HTMLTree or its nodes. Avoid storing `DOMNode` references across modification operations.
For critical applications, consider building Resiliparse binaries with the latest Lexbor Git master or be aware of potential edge-case parsing issues.
While a 'best guess' is often sufficient, be aware of the internal remapping and fallback logic. For highly critical encoding scenarios, manual pre-processing with `detect_encoding()` and `bytes_to_str()` might offer more granular control.
Ensure `pip install fastwarc` is run if you plan to work with WARC archives.
Install the Rust toolchain by following the instructions on `rustup.rs`, then retry `pip install resiliparse`.
Install the package using `pip install resiliparse`.
Import from the correct subpackage: `from resiliparse.extract import html2text`.
Encode the string to bytes before passing it to the function, for example: `html_string.encode('utf-8')`.