diff options
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -32,9 +32,12 @@ async def root(): search = session.get("https://dilbert.com/strip/" + date) soup = bs4.BeautifulSoup(search.text, features="lxml") - comicTitle = soup.find("meta", property="og:title")["content"] - comicURL = soup.find("meta", property="og:image")["content"] - comicAuthor = soup.find("meta", property="article:author")["content"] + try: + comicTitle = soup.find("meta", property="og:title")["content"] + comicURL = soup.find("meta", property="og:image")["content"] + comicAuthor = soup.find("meta", property="article:author")["content"] + except: + continue url = "https://dilbert.com/strip/" + date sneed.add_item( title=comicTitle, description=comicURL, author_name=comicAuthor, link=url, id=id) |