diff --git a/weboob/tools/browser2/filters.py b/weboob/tools/browser2/filters.py index 4340508f9755cfa81ddad0139dc6697f8f45df7e..17c714aafe057ad01064be3783f2999756d569fc 100644 --- a/weboob/tools/browser2/filters.py +++ b/weboob/tools/browser2/filters.py @@ -209,7 +209,9 @@ def filter(self, txt): @classmethod def clean(cls, txt): - return html2text(html.tostring(txt, encoding=unicode)) + if not isinstance(txt, basestring): + txt = html.tostring(txt, encoding=unicode) + return html2text(txt) class RawText(Filter):