Question: OUTPUT: Template given: (Python) https://drive.google.com/file/d/1SmUUR0dbztAzs1nUXQphhoaAm37wwCXK/view?usp=sharing 2. Write class ImgParser that is a subclass of the HTMLParser class. It will find and collect the contents of

OUTPUT:

Template given: (Python)
https://drive.google.com/file/d/1SmUUR0dbztAzs1nUXQphhoaAm37wwCXK/view?usp=sharing
2. Write class ImgParser that is a subclass of the HTMLParser class. It will find and collect the contents of all the images in an HTML file fed to it. The parser works by identifying when a img tag and extracting the href attribute. To implement this parser, you wil need to override the following methods of the HTMLParser class: init to the empty list. handle_starttag: If the tag that resulted in this method being called is an img tag, from here you can get its attributes to see the value of href. a- : The constructor calls the parent class constructor and sets an internal list b. c. getlmages0: The function returns the list of images gathered by the parser
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
