Thread: Fix a recipe
View Single Post
Old 03-29-2011, 10:28 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You might find it easier to extract the correct link from the descriptions in the RSS feed. To do that implement the get_article_url function in your recipe.

Something like

from calibre import browser

Code:
def get_article_url(self, article):
   original_url = BasicNewsRecipe.get_article_url(self, article)
   raw = browser().open_novisit(original_url).read()
   soup = BeautifulSoup(raw)
   # Find the link to the actual article in the soup and return that

Last edited by kovidgoyal; 03-29-2011 at 10:35 AM.
kovidgoyal is offline   Reply With Quote