¡@

Home 

python Programming Glossary: self.recording

How can I use the python HTMLParser library to extract data from a specific div tag?

http://stackoverflow.com/questions/3276040/how-can-i-use-the-python-htmlparser-library-to-extract-data-from-a-specific-div

def __init__ self HTMLParser.HTMLParser.__init__ self self.recording 0 self.data def handle_starttag self tag attributes if tag 'div'.. handle_starttag self tag attributes if tag 'div' return if self.recording self.recording 1 return for name value in attributes if name.. self tag attributes if tag 'div' return if self.recording self.recording 1 return for name value in attributes if name 'id' and value..