Glad I could help.
You're almost there with your next hurdle. Try this:
for a in soup.findAll('a'):
img = a.find('img')
if img is not None:
a.replaceWith(img)
else:
fn = a.find('span',attrs={'class':'fn'})
if fn is not None:
a.replaceWith(fn)
else:
a.extract()