def findFirstHref(link_attrs_list, target_rel):
 matches = findLinksRel(link_attrs_list, target_rel)
 if (not matches):
  return None
 first = matches[0]
 return first.get('href')

def findFirstHref ( link_attrs_list , target_rel ) : matches = findLinksRel ( link_attrs_list , target_rel ) if ( not matches ) : return None first = matches [ 0 ] return first . get ( 'href' )
return the value of the href attribute for the first link tag in the list that has target_rel as a relationship .