home · contact · privacy
Fix NoneType bug.
[plomlombot-irc.git] / plomlombot.py
index 1be105cbdf51325b4817177cb34f29860c57ac1a..75cfe25344a7bbaf32fa977c944e11ca85362196 100755 (executable)
@@ -322,8 +322,8 @@ def handle_url(url, notice, show_url=False):
         return
     if mobile_twitter_hack(url):
         return
-    title = bs4.BeautifulSoup(r.text, "html.parser").title
-    if title:
+    title = bs4.BeautifulSoup(r.text, "html5lib").title
+    if title and title.string:
         prefix = "PAGE TITLE: "
         if show_url:
             prefix = "PAGE TITLE FOR <" + url + ">: "