Fixing NoneType error when no author is given

This commit is contained in:
Patrick Müller 2022-07-06 18:51:10 +02:00
parent 050861d536
commit 0a2724faf4
Signed by: Paddy
GPG Key ID: 37ABC11275CAABCE

View File

@ -49,6 +49,9 @@ class Crawler:
return urls return urls
def __check_for_yaa__(self, soup) -> bool: def __check_for_yaa__(self, soup) -> bool:
if not soup.find(class_='article-author'):
return False
author = soup.find(class_='article-author').text author = soup.find(class_='article-author').text
if 'yaa' in author: if 'yaa' in author: