Skip to content

Commit

Permalink
fix: handle potential errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Helias committed Feb 18, 2024
1 parent cbdf0d3 commit 82adde6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion module/scraper/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ def find_info(article: any) -> tuple:

# finds the info of an article
href_article = article.find_all('a', href=True, title=True)
title_article = href_article[1].get_text()

if len(href_article) > 1:
title_article = href_article[1].get_text()
else:
title_article = None

div_article = article.find('div', {'class': 'slide-meta'})
link_article = article.find('a')
link_article = link_article['href']
Expand Down

0 comments on commit 82adde6

Please sign in to comment.