Searching a string and extract all occurancies of a substring

Nico Grubert nicogrubert at gmail.com
Thu Aug 31 12:36:34 EDT 2006


> This works as long as there are no other <paramter> Tags in the content 
> that I parse.

Got it.

I forgot to handle the 'attrs' parameter in handle_starttag().

Changed it to:

     def handle_starttag(self, tag, attrs):
         if tag == 'parameter':
             if attrs == [('key', 'infobox_path')]:
                 self.readingpaths = 1

This works so far.



More information about the Python-list mailing list