summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorMichael Yick <cavemanon@mail.snootgame.xyz>2023-02-27 20:01:55 -0600
committerMichael Yick <cavemanon@mail.snootgame.xyz>2023-02-27 20:01:55 -0600
commit3215b065400d239b074d9206961616a6d3e376bb (patch)
treeaa04bfdc953f8b64a6bda878babaa2b74746a8cb /main.py
parent96adb62ce1ab2f75d2b3f51ccad5ae69604c340b (diff)
downloaddilbertRss-master.tar.gz
dilbertRss-master.tar.bz2
dilbertRss-master.zip
if there's no comic, then break the loopHEADmaster
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.py b/main.py
index 2293634..3aa5fb5 100755
--- a/main.py
+++ b/main.py
@@ -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)