Snippets Collections
from html.parser import HTMLParser

class MyHTMLParser(HTMLParser):
    def handle_starttag(self, tag, attrs):
        print("Encountered a start tag:", tag)
    def handle_endtag(self, tag):
        print("Encountered an end tag :", tag)
    def handle_data(self, data):
        print("Encountered some data  :", data)

parser = MyHTMLParser()
            '<body><h1>Parse me!</h1></body></html>')

Thu Jan 02 2020 19:00:00 GMT+0000 (UTC)

#html #python #xhtml

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension