def previousIndex(self, attrs):
    ' returns the index of certain set of attributes (of a link) in the\n            self.a list\n\n            If the set of attributes is not found, returns None\n        '
    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
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
def previousIndex(self, attrs):
    ' returns the index of certain set of attributes (of a link) in the\n            self.a list\n\n            If the set of attributes is not found, returns None\n        '
    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