From 2145eb7b8a89fafd4c7631a23f3de01bd1a87570 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Wed, 23 Aug 2023 11:46:37 +0200 Subject: [PATCH] fix: [title] fix None title --- bin/lib/crawlers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/lib/crawlers.py b/bin/lib/crawlers.py index 3e61ed88..6e9132d2 100755 --- a/bin/lib/crawlers.py +++ b/bin/lib/crawlers.py @@ -234,7 +234,9 @@ def extract_title_from_html(html): soup = BeautifulSoup(html, 'html.parser') title = soup.title if title: - return str(title.string) + title = title.string + if title: + return str(title) return '' def extract_description_from_html(html): @@ -2022,4 +2024,4 @@ if __name__ == '__main__': # _reprocess_all_hars_cookie_name() # _reprocess_all_hars_etag() # _gzip_all_hars() - _reprocess_all_hars_hhhashs() + # _reprocess_all_hars_hhhashs()