*get the filename from a URL.*

    *Will return 'untitled.html', if no filename is found.*

    **Key Arguments:**
        - ``url`` -- the url to extract filename from

    Returns:
        - ``filename`` -- the filename

    **Usage:**
        .. code-block:: python 

            from fundamentals.download import extract_filename_from_url
            name = extract_filename_from_url(
                log=log,
                url="https://en.wikipedia.org/wiki/Docstring"
            )
            print name
            # OUT: Docstring.html

def extract_filename_from_url(log, url):
    """
    *get the filename from a URL.*

    *Will return 'untitled.html', if no filename is found.*

    **Key Arguments:**
        - ``url`` -- the url to extract filename from

    Returns:
        - ``filename`` -- the filename

    **Usage:**
        .. code-block:: python 

            from fundamentals.download import extract_filename_from_url
            name = extract_filename_from_url(
                log=log,
                url="https://en.wikipedia.org/wiki/Docstring"
            )
            print name
            # OUT: Docstring.html
    """
    ## > IMPORTS ##
    import re
    # EXTRACT THE FILENAME FROM THE URL
    try:
        log.debug("extracting filename from url " + url)
        reEoURL = re.compile('([\w\.]*)$')
        filename = reEoURL.findall(url)[0]
        # log.debug(filename)
        if(len(filename) == 0):
            filename = 'untitled.html'
        if not (re.search('\.', filename)):
            filename = filename + '.html'
    except Exception as e:
        filename = None
        # print url
        log.warning("could not extracting filename from url : " + str(e) + "\n")

    return filename