HTMLParser bug?

Aahz Maruch aahz at netcom.com
Thu Dec 30 14:58:59 EST 1999


In article <m3zousfd2u.fsf at havenrock.com>,
Matt Gushee  <mgushee at havenrock.com> wrote:
>
>At first I tried creating the parser instance in my __init__ method,
>but I ran into trouble because the parser seems to preserve data
>between invocations, even if I call the reset() method -- so that,
>when my parsing function has to construct absolute URLs from relative
>ones, it often puts old paths (i.e., leftover data in
>self.parser.anchorlist) together with new hostnames.
>
>The problem goes away if I create a new parser instance for every
>page, but I wanted to avoid that if I could. Is this a bug, or have I
>misunderstood how to use htmllib?

I'm not sure, but I always create a new parser instance.  I don't think
it costs you anything.
--
                      --- Aahz (@netcom.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

TEOTWAWKI -- 2 days and counting!



More information about the Python-list mailing list