toolware/utils/generic.py
def get_domain(url):
    """ Returns domain name portion of a URL """
    if 'http' not in url.lower():
        url = 'http://{}'.format(url)
    return urllib.parse.urlparse(url).hostname
def get_domain(url):
    """ Returns domain name portion of a URL """
    if 'http' not in url.lower():
        url = 'http://{}'.format(url)
    return urllib.parse.urlparse(url).hostname
Returns domain name portion of a URL