def _get_unique_links(page_url, soup):
if "<STR_LIT>" not in page_url and "<STR_LIT>" not in page_url:<EOL><INDENT>return []<EOL><DEDENT>prefix = '<STR_LIT>'<EOL>if page_url.startswith('<STR_LIT>'):<EOL><INDENT>prefix = '<STR_LIT>'<EOL><DEDENT>simple_url = page_url.split('<STR_LIT>')[<NUM_LIT:1>]<EOL>base_url = simple_url.split('<STR_LIT:/>')[<NUM_LIT:0>]<EOL>full_base_url = prefix + "<STR_LIT>" + base_url<EOL>raw_links = []<EOL>raw_unique_links = []<EOL>links = soup.find_all('<STR_LIT:a>')<EOL>for link in links:<EOL><INDENT>raw_links.append(link.get('<STR_LIT>'))<EOL><DEDENT>img_links = soup.find_all('<STR_LIT>')<EOL>for img_link in img_links:<EOL><INDENT>raw_links.append(img_link.get('<STR_LIT:src>'))<EOL><DEDENT>links = soup.find_all('<STR_LIT>')<EOL>for link in links:<EOL><INDENT>raw_links.append(link.get('<STR_LIT>'))<EOL><DEDENT>img_links = soup.find_all('<STR_LIT>')<EOL>for img_link in img_links:<EOL><INDENT>raw_links.append(img_link.get('<STR_LIT:src>'))<EOL><DEDENT>for link in raw_links:<EOL><INDENT>if link not in raw_unique_links:<EOL><INDENT>raw_unique_links.append(link)<EOL><DEDENT><DEDENT>unique_links = []<EOL>for link in raw_unique_links:<EOL><INDENT>if link and len(link) > <NUM_LIT:1>:<EOL><INDENT>if link.startswith('<STR_LIT>'):<EOL><INDENT>link = prefix + link<EOL><DEDENT>elif link.startswith('<STR_LIT:/>'):<EOL><INDENT>link = full_base_url + link<EOL><DEDENT>elif link.startswith('<STR_LIT>'):<EOL><INDENT>link = full_base_url + link[<NUM_LIT:1>:]<EOL><DEDENT>elif link.startswith('<STR_LIT:#>'):<EOL><INDENT>link = full_base_url + link<EOL><DEDENT>elif '<STR_LIT>' not in link:<EOL><INDENT>link = full_base_url + "<STR_LIT:/>" + link<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>unique_links.append(link)<EOL><DEDENT><DEDENT>return unique_links<EOL>
Returns all unique links.
Includes:
    "a"->"href", "img"->"src", "link"->"href", and "script"->"src" links.