def _print_parsed_webpage(
            self):
        """*print the parsed/cleaned webpage*

        **Return:**
            - ``pdfPath`` -- the path to the generated PDF
        """
        self.log.debug('starting the ``_print_parsed_webpage()`` method')

        from polyglot import htmlCleaner
        cleaner = htmlCleaner(
            log=self.log,
            settings=self.settings,
            url=self.url,
            outputDirectory=self.folderpath,
            title=self.title,  # SET TO FALSE TO USE WEBPAGE TITLE,
            style=True,  # add polyglot's styling to the HTML document
            metadata=True,  # include metadata in generated HTML (e.g. title),
            h1=True  # include title as H1 at the top of the doc
        )
        htmlFile = cleaner.clean()
        if not htmlFile:
            return

        pdfPath = htmlFile.replace(".html", self.append + ".pdf")

        # CONVERT TO PDF WITH ELECTON PDF
        electron = self.settings["executables"]["electron path"]
        cmd = """%(electron)s -i "%(htmlFile)s" -o "%(pdfPath)s" """ % locals()
        p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
        stdout, stderr = p.communicate()
        if len(stderr):
            print stderr
        self.log.debug('output: %(stdout)s' % locals())

        # REMOVE HTML FILE
        os.remove(htmlFile)

        exists = os.path.exists(pdfPath)
        if not exists:
            print "%(pdfPath)s was not generated for some reason - please investigate" % locals()
            sys.exit(0)

        self.log.debug('completed the ``_print_parsed_webpage()`` method')
        return pdfPath
def _print_parsed_webpage ( self ) : self . log . debug ( 'starting the ``_print_parsed_webpage()`` method' ) from polyglot import htmlCleaner cleaner = htmlCleaner ( log = self . log , settings = self . settings , url = self . url , outputDirectory = self . folderpath , title = self . title , style = True , metadata = True , h1 = True ) htmlFile = cleaner . clean ( ) if not htmlFile : return pdfPath = htmlFile . replace ( ".html" , self . append + ".pdf" ) electron = self . settings [ "executables" ] [ "electron path" ] cmd = """%(electron)s -i "%(htmlFile)s" -o "%(pdfPath)s" """ % locals ( ) p = Popen ( cmd , stdout = PIPE , stderr = PIPE , shell = True ) stdout , stderr = p . communicate ( ) if len ( stderr ) : print stderr self . log . debug ( 'output: %(stdout)s' % locals ( ) ) os . remove ( htmlFile ) exists = os . path . exists ( pdfPath ) if not exists : print "%(pdfPath)s was not generated for some reason - please investigate" % locals ( ) sys . exit ( 0 ) self . log . debug ( 'completed the ``_print_parsed_webpage()`` method' ) return pdfPath
*print the parsed/cleaned webpage*

        **Return:**
            - ``pdfPath`` -- the path to the generated PDF