how to read html file in python code example Example: how to open html file in python file = codecs.open("sample.html", "r", "utf-8")