diff --git a/modules/url.py b/modules/url.py index 0d1d7cd..7171b21 100644 --- a/modules/url.py +++ b/modules/url.py @@ -114,7 +114,8 @@ class MatrixModule(BotModule): # try parse and get the title try: soup = BeautifulSoup(r.text, "html.parser") - title = soup.title.string.strip() + if soup.head and soup.head.title: + title = soup.head.title.string.strip() descr_tag = soup.find("meta", attrs={"name": "description"}) if descr_tag: description = descr_tag.get("content", None)