View Single Post
Old 03-28-2025, 12:42 PM   #1
Glenn680
Member
Glenn680 began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jan 2024
Device: Kobo
Update Newspaper Front Cover

Hi, created a simple recipe that would include the newspaper front page each day. However that newspaper front cover is no longer updated daily on the current site. So I found a new site to pull the newspaper cover which is updated daily- but the recipe is not working. Not sure what I'm doing wrong (?)

Previous recipe (worked well):
def get_cover_url(self):
soup = self.index_to_soup('https://www.frontpages.com/star-tribune/')
return 'https://www.frontpages.com' + soup.find('img', attrs={'id':'giornale-img'})['src']

New recipe (not working):
def get_cover_url(self):
soup = self.index_to_soup('https://frontpages.freedomforum.org/newspapers/mn_st-Star_Tribune')
return 'https://frontpages.freedomforum.org' + soup.find('img', attrs={'id':'giornale-img'})['src']

Please let me know how to fix. The new recipe only pulls a generic cover. Thanks.
Glenn680 is offline   Reply With Quote