sgmllib parser keeps old tag data?

andrew cooke andrew at acooke.org
Fri Feb 13 09:27:51 EST 2009


you are declaring class variables, not instance variables.  you need to
declare these in an __init__ method.  RTFM. 
http://docs.python.org/tutorial/classes.html#a-first-look-at-classes

Berend van Berkum wrote:
> class MyParser(sgmllib.SGMLParser):
> 
> content = ''
> markup = []
> span_stack = []





More information about the Python-list mailing list