how to open html file in python 1

how to open html file in python

file = codecs.open("sample.html", "r", "utf-8")

Here is what the above code is Doing:
1. We’re importing the codecs module.
2. We’re opening the sample.html file in read mode.
3. We’re reading the file and storing it in the variable html_file.

Similar Posts