def wikipedia_url_parse(url):
    seed_page = "https://en.wikipedia.org"  #Crawling the English Wikipedia
    try:
        from urllib.parse import urlparse
    except __HOLE__:
        from urlparse import urlparse
    url = url  #.lower()    #Make it lower case
    s = urlparse(url)       #parse the given url
    seed_page_n = seed_page #.lower()       #Make it lower case
    #t = urlparse(seed_page_n)     #parse the seed page (reference page)
    i = 0
    flag = 0
    while i<=9:
        if url == "/":
            url = seed_page_n
            flag = 0  
        elif not s.scheme:
            url = "http://" + url
            flag = 0
        elif "#" in url:
            url = url[:url.find("#")]
            flag = 0
        elif "?" in url:
            url = url[:url.find("?")]
            flag = 0
        elif s.netloc == "":
            url = seed_page + s.path
            flag = 0    
        elif url[len(url)-1] == "/":
            url = url[:-1]
            flag = 0
        else:
            url = url
            flag = 0
            break  
        i = i+1
        s = urlparse(url)   #Parse after every loop to update the values of url parameters
    return(url, flag)

#Main Crawl function that calls all the above function and crawls the entire site sequentially
dataset/ETHPy150Open hardikvasa/webb/webb/webb.py/wikipedia_url_parse