summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libhtmlparser.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-09-10 01:20:21 (GMT)
committerFred Drake <fdrake@acm.org>2004-09-10 01:20:21 (GMT)
commit961c2882a920f137543585175db9957bf48223f3 (patch)
treedf8ee0408a4d7890b09a51611012ab746bda48e7 /Doc/lib/libhtmlparser.tex
parenta2544ee7f0ecbab945d1bb6bb8de6a72c71768ed (diff)
downloadcpython-961c2882a920f137543585175db9957bf48223f3.zip
cpython-961c2882a920f137543585175db9957bf48223f3.tar.gz
cpython-961c2882a920f137543585175db9957bf48223f3.tar.bz2
document the exceptions raised by sgmllib, htmllib, and HTMLParser
Diffstat (limited to 'Doc/lib/libhtmlparser.tex')
-rw-r--r--Doc/lib/libhtmlparser.tex13
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/lib/libhtmlparser.tex b/Doc/lib/libhtmlparser.tex
index 5ba8e86..b85ba56 100644
--- a/Doc/lib/libhtmlparser.tex
+++ b/Doc/lib/libhtmlparser.tex
@@ -4,6 +4,8 @@
\declaremodule{standard}{HTMLParser}
\modulesynopsis{A simple parser that can handle HTML and XHTML.}
+\versionadded{2.2}
+
This module defines a class \class{HTMLParser} which serves as the
basis for parsing text files formatted in HTML\index{HTML} (HyperText
Mark-up Language) and XHTML.\index{XHTML} Unlike the parser in
@@ -23,6 +25,17 @@ that end tags match start tags or call the end-tag handler for
elements which are closed implicitly by closing an outer element.
\end{classdesc}
+An exception is defined as well:
+
+\begin{excdesc}{HTMLParseError}
+Exception raised by the \class{HTMLParser} class when it encounters an
+error while parsing. This exception provides three attributes:
+\member{msg} is a brief message explaining the error, \member{lineno}
+is the number of the line on which the broken construct was detected,
+and \member{offset} is the number of characters into the line at which
+the construct starts.
+\end{excdesc}
+
\class{HTMLParser} instances have the following methods: