def parse_domain_from_url(url):
    import tldextract
    extracted = tldextract.extract(url)
    scheme, _, _, _, _, _ = parse_url(url)

    sld = extracted.domain
    tld = extracted.suffix
    subdomain = extracted.subdomain
    name = '.'.join([sld, tld]) if tld else sld
    netloc = '.'.join([subdomain, name]) if subdomain else name

    return netloc, name, scheme, sld, tld, subdomain
Extract domain info from a passed url.
dataset/ETHPy150Open scrapinghub/frontera/frontera/utils/url.py/parse_domain_from_url