Make html parsing python 3 compatible.

htmlentitydefs was renamed to html.entities.
HTMLParser was renamed to html.parser.