@unique_values<EOL>def find_external_links(url, page):
for match in REL.finditer(page):<EOL><INDENT>tag, rel = match.groups()<EOL>rels = set(map(str.strip, rel.lower().split('<STR_LIT:U+002C>')))<EOL>if '<STR_LIT>' in rels or '<STR_LIT>' in rels:<EOL><INDENT>for match in HREF.finditer(tag):<EOL><INDENT>yield urljoin(url, htmldecode(match.group(<NUM_LIT:1>)))<EOL><DEDENT><DEDENT><DEDENT>for tag in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>pos = page.find(tag)<EOL>if pos!=-<NUM_LIT:1>:<EOL><INDENT>match = HREF.search(page,pos)<EOL>if match:<EOL><INDENT>yield urljoin(url, htmldecode(match.group(<NUM_LIT:1>)))<EOL><DEDENT><DEDENT><DEDENT>
Find rel="homepage" and rel="download" links in `page`, yielding URLs