Re: Searching a string and extract all occurancies of a substring



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.
.


Quantcast