Strip html title

This commit is contained in:
Paal Braathen committed 2013-03-19 12:01:43 +01:00
1 parent ef99764a5d
commit cb9edb2ccf
1 file changed
+3 -2
+3 -2
View File
@@ -189,7 +189,8 @@ class IRCActions():
url = urlmatch.group()
try:
i = urllib2.urlopen(url, timeout=3)
except:
except Exception as e:
log(e)
self.bot.msgReply(nick, channel, reply + "Timeout")
return
statuscode = i.getcode()
@@ -203,7 +204,7 @@ class IRCActions():
tree = lxml.html.fromstring(partialhtml)
title = tree.find(".//title")
if title is not None and title.text is not None:
reply += "[%s]" % title.text
reply += "[%s]" % title.text.strip()
# DEBUG
if title is None:
reply += "<title is none>"