You are viewing a single comment's thread. Return to all comments →
class MyHTMLParser(HTMLParser): def handle_starttag(self,tag,attrs): print(tag) for name, value in attrs: print(f"-> {name} > {value}") def handle_startendtag(self,tag,attrs): print(tag) for name, value in attrs: print(f"-> {name} > {value}") def handle_comment(self,data): pass html = '\n'.join(input() for _ in range(int(input()))) MyHTMLParser().feed(html)
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 →