View Single Post
Old 04-22-2010, 12:47 PM   #1831
gambarini
Connoisseur
gambarini began at the beginning.
 
Posts: 98
Karma: 22
Join Date: Mar 2010
Device: IRiver Story, Ipod Touch, Android SmartPhone
Quote:
Originally Posted by Starson17 View Post
Here is the documentation. I've read that page many times and keep going back. There would be many ways to find the tag you need with BeautifulSoup navigation. You can use a regular expression to match it, or a findNextSibliing, etc. I am certainly not an expert, but I would try to construct a command that finds this tag, then print the tag found, then see if what gets printed is what you expected. If not, adjust, etc. until it prints the right tag.
Code:
    def print_version(self, url):
        raw = self.browser.open(url).read()
        soup = BeautifulSoup(raw.decode('utf8', 'replace'))
        print_link = soup.find('a', {'class':'printarticle'})
        return  'www.infomotori.com' + print_link['href'] 
        feeds          =     [(u'Ultime Novit\xe0', u'http://feeds.infomotori.com/ultimenovita')]
In this case the print link appeare good in debug, but the calibre return "can't download article. try -vv for details"

Last edited by gambarini; 04-23-2010 at 03:08 AM.
gambarini is offline