class MyParser(HTMLParser):

    def __init__(self, output_list=None):
        HTMLParser.__init__(self)
if output_list is None:
    self.output_list = []
else:
    self.output_list = output_list

def handle_starttag(self, tag, attrs):
    pass
Regex to find urls in string in Python