def url_fix_common_typos ( url ) : if url . startswith ( "http//" ) : url = "http://" + url [ 6 : ] elif url . startswith ( "https//" ) : url = "https://" + url [ 7 : ] return url
fix bad urls python
Fix common typos in given URL like forgotten colon .
def url_fix_common_typos (url):
    """Fix common typos in given URL like forgotten colon."""
    if url.startswith("http//"):
        url = "http://" + url[6:]
    elif url.startswith("https//"):
        url = "https://" + url[7:]
    return url