HTMLParser error

alex23 wuwei23 at gmail.com
Wed May 21 06:08:40 EDT 2008


On May 21, 8:04 pm, alex23 <wuwe... at gmail.com> wrote:
> Is your Spider class a subclass of HTMLParser? Is it over-riding
> __init__? If so, is it doing something like:
>
>     super(Spider, self).__init__()
>
> If this is your issue[...]

I'm sorry, this really wasn't clear at all. What I meant was that you
need to call the HTMLParser.__init__ inside your Spider.__init__ in
order to have it initialise properly. Failing to do so would lead to
the .rawdata attribute not being defined. The super() function is the
best way to achieve this.

Sorry for the rambling, hopefully some of that is relevant.

- alex23



More information about the Python-list mailing list