diff --git a/check.py b/check.py index 31ae4d7..ff109fe 100755 --- a/check.py +++ b/check.py @@ -9,7 +9,7 @@ from email.utils import formatdate, make_msgid import requests -re_title = re.compile("(.*?)") +re_title = re.compile("(.*?)", re.DOTALL) AGENT = "Mozilla/5.0 (Windows NT 6.1) Gecko/20100101 Firefox/29.0" headers = {"User-Agent": AGENT, "Accept": "text/html"} @@ -56,7 +56,7 @@ def find_not_here_message(html: str) -> str | None: def get_title(html: str) -> str: """Title from web page.""" m = re_title.search(html) - return m.group(1) if m and m.group(1) else "no title" + return m.group(1).strip() if m and m.group(1) else "no title" def check_conference(name: str, url: str) -> tuple[bool, str]: