(self, htmloutfile)
Formats site information correctly and prints it to an output file using HTML markup.
        Returns nothing.

        Argument(s):
        htmloutfile -- A string representation of a file that will store the output.

        Return value(s):
        Nothing is returned from this Method.

        Restriction(s):
        The Method has no restrictions.
Formats site information correctly and prints it to an output file using HTML markup.
        Returns nothing.
Formats site information correctly and prints it to an output file using HTML markup . Returns nothing .
def PrintToHTMLFile(self, htmloutfile):
        """
        Formats site information correctly and prints it to an output file using HTML markup.
        Returns nothing.

        Argument(s):
        htmloutfile -- A string representation of a file that will store the output.

        Return value(s):
        Nothing is returned from this Method.

        Restriction(s):
        The Method has no restrictions.
        """
        sites = sorted(self.ListOfSites, key=attrgetter('Target'))
        target = ""
        print '\n[+] Generating HTML output: ' + htmloutfile
        f = open(htmloutfile, "w")
        f.write(self.getHTMLOpening())
        if sites is not None:
            for site in sites:
                if not isinstance(site._regex,basestring): #this is a multisite:
                    for index in range(len(site.RegEx)): #the regexs will ensure we have the exact number of lookups
                        siteimpprop = site.getImportantProperty(index)
                        if siteimpprop is None or len(siteimpprop)==0:
                            tgt = site.Target
                            typ = site.TargetType
                            source = site.FriendlyName[index]
                            res = "No results found"
                            tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str(res) + '</td></tr>'
                            f.write(tableData)
                        else:
                            if siteimpprop[index] is None or len(siteimpprop[index])==0:
                                tgt = site.Target
                                typ = site.TargetType
                                source = site.FriendlyName[index]
                                res = "No results found"
                                tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str(res) + '</td></tr>'
                                f.write(tableData)
                            else:
                                # if it's just a string we don't want it to output like a list
                                if isinstance(siteimpprop, basestring):
                                    tgt = site.Target
                                    typ = site.TargetType
                                    source = site.FriendlyName
                                    res = siteimpprop
                                    tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str(res) + '</td></tr>'
                                    f.write(tableData)
                                else:
                                    for siteresult in siteimpprop[index]:
                                        tgt = site.Target
                                        typ = site.TargetType
                                        source = site.FriendlyName[index]
                                        res = siteresult
                                        tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str(res) + '</td></tr>'
                                        f.write(tableData)
                else:  # this is a singlesite
                    siteimpprop = site.getImportantProperty(0)
                    if siteimpprop is None or len(siteimpprop)==0:
                        tgt = site.Target
                        typ = site.TargetType
                        source = site.FriendlyName
                        res = "No results found"
                        tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str(res) + '</td></tr>'
                        f.write(tableData)
                    else:
                        # if it's just a string we don't want it output like a list
                        if isinstance(siteimpprop, basestring):
                            tgt = site.Target
                            typ = site.TargetType
                            source = site.FriendlyName
                            res = siteimpprop
                            tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str(res) + '</td></tr>'
                            f.write(tableData)
                        else:
                            for siteresult in siteimpprop:
                                tgt = site.Target
                                typ = site.TargetType
                                source = site.FriendlyName
                                res = siteresult
                                tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str(res) + '</td></tr>'
                                f.write(tableData)
        f.write(self.getHTMLClosing())
        f.flush()
        f.close()
        print "" + htmloutfile + " Generated"
def PrintToHTMLFile ( self , htmloutfile ) : sites = sorted ( self . ListOfSites , key = attrgetter ( 'Target' ) ) target = "" print '\n[+] Generating HTML output: ' + htmloutfile f = open ( htmloutfile , "w" ) f . write ( self . getHTMLOpening ( ) ) if sites is not None : for site in sites : if not isinstance ( site . _regex , basestring ) : #this is a multisite: for index in range ( len ( site . RegEx ) ) : #the regexs will ensure we have the exact number of lookups siteimpprop = site . getImportantProperty ( index ) if siteimpprop is None or len ( siteimpprop ) == 0 : tgt = site . Target typ = site . TargetType source = site . FriendlyName [ index ] res = "No results found" tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str ( res ) + '</td></tr>' f . write ( tableData ) else : if siteimpprop [ index ] is None or len ( siteimpprop [ index ] ) == 0 : tgt = site . Target typ = site . TargetType source = site . FriendlyName [ index ] res = "No results found" tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str ( res ) + '</td></tr>' f . write ( tableData ) else : # if it's just a string we don't want it to output like a list if isinstance ( siteimpprop , basestring ) : tgt = site . Target typ = site . TargetType source = site . FriendlyName res = siteimpprop tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str ( res ) + '</td></tr>' f . write ( tableData ) else : for siteresult in siteimpprop [ index ] : tgt = site . Target typ = site . TargetType source = site . FriendlyName [ index ] res = siteresult tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str ( res ) + '</td></tr>' f . write ( tableData ) else : # this is a singlesite siteimpprop = site . getImportantProperty ( 0 ) if siteimpprop is None or len ( siteimpprop ) == 0 : tgt = site . Target typ = site . TargetType source = site . FriendlyName res = "No results found" tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str ( res ) + '</td></tr>' f . write ( tableData ) else : # if it's just a string we don't want it output like a list if isinstance ( siteimpprop , basestring ) : tgt = site . Target typ = site . TargetType source = site . FriendlyName res = siteimpprop tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str ( res ) + '</td></tr>' f . write ( tableData ) else : for siteresult in siteimpprop : tgt = site . Target typ = site . TargetType source = site . FriendlyName res = siteresult tableData = '<tr><td>' + tgt + '</td><td>' + typ + '</td><td>' + source + '</td><td>' + str ( res ) + '</td></tr>' f . write ( tableData ) f . write ( self . getHTMLClosing ( ) ) f . flush ( ) f . close ( ) print "" + htmloutfile + " Generated"