• + 0 comments
    class MyHTMLParser(HTMLParser):
            
        def handle_starttag(self, tag, attrs):
            print("Start :", tag)
            [print('->', nm, '>', value) for nm, value in attrs]
    
        def handle_endtag(self, tag):
            print("End   :", tag)
            
        def handle_startendtag(self, tag, attrs):
            print("Empty :", tag)
            [print('->', nm, '>', value) for nm, value in attrs]
    
        def handle_comment(self, data):
            pass