(self, attrs)
returns the index of certain set of attributes (of a link) in the
            self.a list

            If the set of attributes is not found, returns None
returns the index of certain set of attributes (of a link) in the
            self.a list
returns the index of certain set of attributes ( of a link ) in the self . a list
def previousIndex(self, attrs):
        """ returns the index of certain set of attributes (of a link) in the
            self.a list

            If the set of attributes is not found, returns None
        """
        if not has_key(attrs, 'href'): return None

        i = -1
        for a in self.a:
            i += 1
            match = 0

            if has_key(a, 'href') and a['href'] == attrs['href']:
                if has_key(a, 'title') or has_key(attrs, 'title'):
                        if (has_key(a, 'title') and has_key(attrs, 'title') and
                            a['title'] == attrs['title']):
                            match = True
                else:
                    match = True

            if match: return i
def previousIndex ( self , attrs ) : if not has_key ( attrs , 'href' ) : return None i = - 1 for a in self . a : i += 1 match = 0 if has_key ( a , 'href' ) and a [ 'href' ] == attrs [ 'href' ] : if has_key ( a , 'title' ) or has_key ( attrs , 'title' ) : if ( has_key ( a , 'title' ) and has_key ( attrs , 'title' ) and a [ 'title' ] == attrs [ 'title' ] ) : match = True else : match = True if match : return i