We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Detect HTML Tags, Attributes and Attribute Values
Detect HTML Tags, Attributes and Attribute Values
Sort by
recency
|
154 Discussions
|
Please Login in order to post a comment
Here is HackerRank Detect HTML Tags, Attributes and Attribute Values in Python solution - https://programmingoneonone.com/hackerrank-detect-html-tags-attributes-and-attribute-values-solution-in-python.html
from html.parser import HTMLParser
class MyHTMLParser(HTMLParser): def handle_starttag(self,tag,attr): print(tag) for name ,value in attr: print(f"-> {name} > {value}")
parser = MyHTMLParser() for i in range(int(input())): parser.feed(input())
parser = MyHTMLParser() for i in range(int(input())): parser.feed(input())
My version :