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.
HTML Parser - Part 2
HTML Parser - Part 2
Sort by
recency
|
139 Discussions
|
Please Login in order to post a comment
Flyingcart is the best Store For Online Shopping In Pakistan With Free Home Delivery To Provide Thousands of Branded Products At One Place Like Apparels, Makeup & More.
from html.parser import HTMLParser
class MyHTMLParser(HTMLParser): def handle_comment(self, data): if '\n' in data: print(">>> Multi-line Comment") print(data) else: print(">>> Single-line Comment") print(data)
html = "" for i in range(int(input())): html += input().rstrip() html += '\n'
parser = MyHTMLParser() parser.feed(html)