View Single Post
Old 09-10-2009, 09:21 PM   #719
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,501
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Cant think of one off hand but basically, it's something like this

Code:
def get_article_url(self, article):
   url = ...(from article as before)
   soup = self.index_to_soup(url)
   # do some processing on soup to find the full article link
   a = soup.find(name='a', href=True, text=re.compile(r'Full\s*Article')
   if a is not None:
      return a['href']
   return url
Stick a few print statements in there to debug things
kovidgoyal is offline