View Single Post
Old 05-16-2011, 10:14 AM   #10
schuster
Zealot
schuster doesn't litterschuster doesn't litter
 
Posts: 119
Karma: 100
Join Date: Jan 2011
Location: Germany / NRW /Köln
Device: prs-650 / prs-350 /kindle 3
yep,
try this

Code:
    no_stylesheets         = True
    use_embedded_content   = False
    remove_javascript      = True

    def print_version(self,url):
          segments = url.split('/') 
          printURL = '/'.join(segments[0:3]) + '/print-this/' + '/'.join(segments[4:])
          return printURL

    def preprocess_html(self, soup):
        for alink in soup.findAll('a'):
            if alink.string is not None:
               tstr = alink.string
               alink.replaceWith(tstr)
        return soup
schuster is offline   Reply With Quote