From 2a7d56df1136d907a6d9303e2dd9b32026f34cd2 Mon Sep 17 00:00:00 2001 From: Israel Yago Pereira Date: Mon, 9 Aug 2021 16:33:28 -0300 Subject: [PATCH] Fallback on any h1 --- src/find_posts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/find_posts.py b/src/find_posts.py index a3cecde..13c43c9 100644 --- a/src/find_posts.py +++ b/src/find_posts.py @@ -14,6 +14,8 @@ def get_title_from_htmltree(htmltree: BeautifulSoup): title = htmltree.select_one('[data-elasticsearch-title]') if title == None: title = htmltree.find('h1', { "class" : "post-title" }) + if title == None: + title = htmltree.find('h1') if title == None: return None return title.text.strip() -- GitLab