def find_external_links(url, page):
 for match in REL.finditer(page):
  (tag, rel) = match.groups()
  rels = map(str.strip, rel.lower().split(','))
  if (('homepage' in rels) or ('download' in rels)):
   for match in HREF.finditer(tag):
    (yield urlparse.urljoin(url, htmldecode(match.group(1))))
 for tag in ('<th>Home Page', '<th>Download URL'):
  pos = page.find(tag)
  if (pos != (-1)):
   match = HREF.search(page, pos)
   if match:
    (yield urlparse.urljoin(url, htmldecode(match.group(1))))

def find_external_links ( url , page ) : for match in REL . finditer ( page ) : ( tag , rel ) = match . groups ( ) rels = map ( str . strip , rel . lower ( ) . split ( ',' ) ) if ( ( 'homepage' in rels ) or ( 'download' in rels ) ) : for match in HREF . finditer ( tag ) : ( yield urlparse . urljoin ( url , htmldecode ( match . group ( 1 ) ) ) ) for tag in ( '<th>Home Page' , '<th>Download URL' ) : pos = page . find ( tag ) if ( pos != ( - 1 ) ) : match = HREF . search ( page , pos ) if match : ( yield urlparse . urljoin ( url , htmldecode ( match . group ( 1 ) ) ) )
find rel="homepage" and rel="download" links in page .