Actually return title text, not html Tag object (title.py)

This commit is contained in:
jesopo 2019-02-09 10:38:44 +00:00
parent 2ac5a53131
commit 9f6aa93082

View file

@ -13,7 +13,11 @@ class Module(ModuleManager.BaseModule):
except Exception as e:
self.log.error("failed to get URL title", exc_info=True)
return None
return page.data.title
if page.data.title:
return page.data.title.text.replace("\n", " ").replace(
"\r", "").replace(" ", " ").strip()
else:
return None
@utils.hook("received.message.channel")
def channel_message(self, event):