From 0a2724faf43b4db831329135fa63505907a468c3 Mon Sep 17 00:00:00 2001 From: Patrick Mueller Date: Wed, 6 Jul 2022 18:51:10 +0200 Subject: [PATCH] Fixing NoneType error when no author is given --- crawler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crawler.py b/crawler.py index d9af85b..4097afd 100644 --- a/crawler.py +++ b/crawler.py @@ -49,6 +49,9 @@ class Crawler: return urls def __check_for_yaa__(self, soup) -> bool: + if not soup.find(class_='article-author'): + return False + author = soup.find(class_='article-author').text if 'yaa' in author: