Add Python3 compatibility for the HTML parser