HTMLParser problem

Valkyrie valkyrie at cuhk.edu.hk
Tue Nov 16 08:14:42 EST 2004


I've fed some data to the HTML parser constructed by myself. Here is the
beginning of the content of the fed data:
=====
<!doctype html public "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1"><link rel="stylesheet"
href="http://us.i1.yimg.com/us.yimg.com/lib/s/yschx_040927.css" type="text/css"
media="all">

<![if !IE]>
...
=====
however, when "<![if !IE]>" is encountered, I found that handle_data() is called
but not handle_decl(), (since I've let the function handle_decl to print sth on
the screen, but nothing happened) and the following error is displayed:

......
HTMLParser.HTMLParseError: unknown declaration: 'if !IE', at line 4, column 1

May I ask why such error is raised? Thanks in advance!



More information about the Python-list mailing list