Ad
Code
Diff
  • def domain_name(url):
        outers = [
            "https://",
            "http://",
            "www.",
            "maps.",
        ]
        for prefix in outers:
            if url.startswith(prefix):
                url =  url[len(prefix):]
     
        return url.split('.')[0]
    • def domain_name(url):
    • outers = [
    • "https://",
    • "http://",
    • "www.",
    • "maps.",
    • ]
    • for prefix in outers:
    • if url.startswith(prefix):
    • url = url[len(prefix):]
    • return url.split('.')[0]