How to Solve NameError: name 'HTMLParser' is not defined -- html

Solution: Import the 'HTMLParser' module

To Solve the error, add the following line to the top of your code.

from html.parser import HTMLParser

 

For more information:
Python html HTMLParser