You are viewing a single comment's thread. Return to all comments →
from html.parser import HTMLParser class MyHTMLParser(HTMLParser): def handle_starttag(self, tag, att): print(tag) self.print_atributes(att) def print_atributes(self, att): for name, val in att: print(f'-> {name} > {val}') parser = MyHTMLParser() for _ in range(int(input())): parser.feed(input())
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 →