SGMLParser error on HTML comment

George Thomas george at cc.gatech.edu
Sat Nov 17 17:04:24 EST 2001


Hi everyone,
There's the following post dated May 28, 2001 from Marcel van den Dungen. 
Didn't see any replies. Has there been a fix ? Does anyone have any ideas 
?
 >>>
Hi,

I'm trying to parse a bunch of HTML files using the SGMLParser class,
which works just fine unless an HTML-file starts with an HTML-comment
marker before the <HTML> opening-tag.
The following error is emited:
  File "c:\python21\lib\sgmllib.py", line 238, in parse_declaration
    raise SGMLParseError(
sgmllib.SGMLParseError: unexpected char in declaration: '<'

Anybody know a fix or workaround for this?

TIA,
Marcel

>>>
rgds
-- 
-------------------------------------------------------------------------
George Thomas
Resident,Planet Earth,Third Rock from the Sun
-------------------------------------------------------------------------
reduce (lambda c,d:chr(ord(d)-2)+c, 'ofcpqkekhhC"zwpkN"fgtgyqR/pqjv{R')
-------------------------------------------------------------------------




More information about the Python-list mailing list