You are viewing a single comment's thread. Return to all comments →
from html.parser import HTMLParser s = '''''' for _ in range(int(input())): s = s + input() + '\n' class MyHTMLParser(HTMLParser): def handle_starttag(self, tag, attrs): print(tag) if attrs: for att in attrs: print(f'-> {att[0]} > {att[1]}') def handle_startendtag(self, tag, attrs): print(tag) if attrs: for att in attrs: print(f'-> {att[0]} > {att[1]}') parser = MyHTMLParser() parser.feed(s)
Seems like cookies are disabled on this browser, please enable them to open this website
Detect HTML Tags, Attributes and Attribute Values
You are viewing a single comment's thread. Return to all comments →