Skip to main content





The HTMLLoader parses HTML-encoded data.

The HTMLoader attempts to parse an HTML file as an XML file. It does not have any understanding of the structure of HTML or the document.

File Extension.html, .htm
MIME Typetext/html
File TypeText
File FormateXtensible Markup Language
Data FormatFree format data structure
Decoder TypeSynchronous
Worker Thread SupportNo
Streaming SupportNo

The HTMLLoader is only expected to be fit-for-purpose for a few limited use cases. It is not intended for full fidelity parsing or display of HTML files. It is designed for minimal ad-hoc use cases such as

  • the extraction of an error string from an HTML formatted error response from a server
  • or possibly to extract some valuable information (perhaps the URL to a geospatial service) from a server that doesn't provide more structured return formats (such as JSON or XML).


import {HTMLLoader} from '';
import {load} from '';

const data = await load(url, HTMLLoader, options);

Data Format

Unstructured, untyped data in the form a tree of JavaScrip objects representing the hierarchy of tags in the HTML file.


For options, see the XMLLoader.



The HTMLLoader is a wrapper around fast-xml-parser.