Get the html under a tag using htmlparser python
问题 I want to get whole html under a tag and using HTMLParser. I am able to currently get the data between the tags and following is my code class LinksParser(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.recording = 0 self.data = '' def handle_starttag(self, tag, attributes): if tag != 'span': return if self.recording: self.recording += 1 return for name, value in attributes: if name == 'itemprop' and value == 'description': break else: return self.recording = 1 def handle