- load_html(+Input, -DOM, +Options) is det
- Load HTML text from Input and unify the resulting DOM structure
with DOM. Options are passed to load_structure/3, after adding
the following default options:
- dtd(DTD)
- Pass the DTD for HTML as obtained using
dtd(html, DTD)
. - dialect(Dialect)
- Current dialect from the Prolog flag
html_dialect
- max_errors(-1)
- syntax_errors(quiet)
- Most HTML encountered in the wild contains errors. Even in the context of errors, the resulting DOM term is often a reasonable guess at the intent of the author.
You may also want to use the library(http/http_open) to support loading from HTTP and HTTPS URLs. For example:
:- use_module(library(http/http_open)). :- use_module(library(sgml)). load_html_url(URL, DOM) :- load_html(URL, DOM, []).