0
from HTMLParser import HTMLParser

class MyHTMLParser(HTMLParser):
    def handle_starttag(self, tag, attrs):
        print ('Start :', tag)
        for ele in attrs:
            print ('->', ele[0], '>', ele[1])

    def handle_endtag(self, tag):
        print ('End   :', tag)

    def handle_startendtag(self, tag, attrs):
        print ('Empty :', tag)
        for ele in attrs:
            print ('->', ele[0], '>', ele[1])

parser = MyHTMLParser()
for _ in range(int(input())):
    parser.feed(input())

What's the use of the last line "parser.feed(input())"? what are the other ways that it can be used

The image of the code

Shravya
  • 1
  • 1
  • 1
  • 3
    Do you know what `parser.feed()` and `input()` are doing? did you try googeling those functions? – Guy Jun 13 '21 at 04:29
  • Yeah, I did. I wasn't able to find the appropriate answers so I thought of putting it up here. I want to know about the parser.feed() – Shravya Jun 13 '21 at 07:16

0 Answers0