diff --git a/html2csv/__main__.py b/html2csv/__main__.py index f5de333..0d5b3c0 100644 --- a/html2csv/__main__.py +++ b/html2csv/__main__.py @@ -38,7 +38,8 @@ def main(): else: path = pathlib.Path(input_source) if path.exists(): - html_doc = path.read_text() + with open(path, 'rb') as f: + html_doc = f.read() else: response = requests.get(input_source) html_doc = response.text