Merge pull request #37 from cfdisk/fix/urltitle

Fix #35
This commit is contained in:
Ville Ranki 2020-02-08 13:36:11 +02:00 committed by GitHub
commit 276f5d3e60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,7 @@ class MatrixModule(BotModule):
# try parse and get the title
try:
soup = BeautifulSoup(r.text, "html.parser")
title = soup.title.string
title = soup.title.string.strip()
descr_tag = soup.find("meta", attrs={"name": "description"})
if descr_tag:
description = descr_tag.get("content", None)