HTMLParser error

jonbutler88 at googlemail.com jonbutler88 at googlemail.com
Wed May 21 04:58:34 EDT 2008


On May 21, 9:53 am, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
> On Wed, 21 May 2008 01:18:00 -0700 (PDT), jonbutle... at googlemail.com
> declaimed the following in comp.lang.python:
>
> > Any ideas of how to fix this? Im using python 2.5.2 on mac osx
>
>         In the absence of minimal runable code reproducing the error
> message...
>
>         Did you remember to INITIALIZE the attribute to a null value
> somewhere prior to that statement?
> --
>         Wulfraed        Dennis Lee Bieber               KD6MOG
>         wlfr... at ix.netcom.com              wulfr... at bestiaria.com
>                 HTTP://wlfraed.home.netcom.com/
>         (Bestiaria Support Staff:               web-a... at bestiaria.com)
>                 HTTP://www.bestiaria.com/

Its not a variable I set, its one of HTMLParser's inbuilt variables. I
am using it with urlopen to get the source of a website and feed it to
htmlparser.

def parse(self, page):
        try:
            self.feed(urlopen('http://' + page).read())
        except HTTPError:
            print 'Error getting page source'

This is the code I am using. I have tested the other modules and they
work fine, but I havn't got a clue how to fix this one.



More information about the Python-list mailing list