A tool to extract all links from a web-page in Python
Code style issues (from top to bottom)


imports - you should properly group imports as per PEP8 - in the first group you would have your system-level imports, then third-party libraries and then your local imports - all groups sorted alphabetically with a blank line between the groups:

import sys
from urllib.parse import urlparse

from bs4 import BeautifulSoup
import requests

docstrings should be enclosed into triple quotes, start with a capital letter and end with a dot. "Main" is though not a descriptive and useful documentation string - see if you can add details about what the function does
variable naming - use descriptive variable names - response instead of r 
watch for spaces around the operators
when comparing to None, you should be using is and not ==, e.g. if anchor is not None - you though actually don't need these comparisons - see below
avoid using bare exception clauses


Other improvements


you should switch to argparse module instead of manually parsing and validating sys.argv
you don't actually need checks against None and filtering the links list - you can enforce the presence of attributes this way:

script_elements = [element['src'] for element in soup.select('script[src]')]
anchor_elements = [element['href'] for element in soup.select('a[href]')]
link_elements = [element['href'] for element in soup.select('link[href]')]
form_elements = [element['action'] for element in soup.select('form[action]')]

links = script_elements + anchor_elements + link_elements + form_elements

if performance is critical, see if you can use lxml instead of html.parser (requires lxml module to be installed):

soup = BeautifulSoup(response.content, "lxml")

see if you can join the current url with the relative link with urljoin() - might simplify the post-processing for the extracted links