I am trying to read the contents of an HTML file with BeautifulSoup
, but I'm receiving an UnicodeDecodeError
.
I also tried changing the parser to html.parser
instead of the lxml
but it doesn't work.
however, if I use the requests
library to request the URL, it works, but not if I read the HTML file locally.
answer:
I needed to add a Unicode and it was should have something like that: with open('lap.html', encoding="utf8") as html_file: