'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):

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