Develop a class ListPrinter as a subclass of the HTMLParser class, which prints a Python list for every unordered list in an HTML web page. Each unordered list in the HTML web page will correspond to a Python list whose elements are the text data that appear in the items of the unordered HTML list. For example, the following
unordered HTML list will result in a Python list [First item', 'Second item', 'Third item').
• First item
• Second item
• Third item
The ListPrinter class should print out each list as it parses an HTML web page. You may assume that every item of every list in the HTML web page does not contain other HTML element, e.g. anchor or image
Python 3.7.4 Shell
File Edit Shell Debug Options Window Help
>>> parser=ListPrinter()
>>> parser.feed('<ul><li>First item</li><li>Second item</li><li>Third item</li><
/ul>')
['First item', 'Second item', 'Third item']
>>> parser.feed('<html><body><h1>Below is a list</h1><ul><li>Item one</li><li>It
em two</li></ul></body></html>')
['Item one', 'Item two']
>>> parser.feed('<ul><li>100</li><li>200</li></ul>Some text<ul><li>Dog</li><li>C
at</li><li>Sheep</li></ul>')
['100', '200']
['Dog', 'Cat', 'Sheep']
>>> parser.feed('<html></html>')
>>>
Lrc 3399 Col 4