From e121faeb2a9e883978fa7c5bf0d01a2a40ded562 Mon Sep 17 00:00:00 2001 From: Adrien Barbaresi Date: Wed, 19 Feb 2020 19:47:42 +0100 Subject: [PATCH] add encoding attribute to parsed tree --- readability/readability.py | 1 + 1 file changed, 1 insertion(+) diff --git a/readability/readability.py b/readability/readability.py index bb1e13a..340c9d7 100755 --- a/readability/readability.py +++ b/readability/readability.py @@ -159,6 +159,7 @@ class Document: def _parse(self, input): if isinstance(input, (_ElementTree, HtmlElement)): doc = input + self.encoding = 'utf-8' else: doc, self.encoding = build_doc(input) doc = html_cleaner.clean_html(doc)