def parse_web_listing(url):
    dirs = []
    files = []

    r = requests.get(url, timeout=3.05)
    if r.status_code != requests.codes.ok:
        raise Exception('HTTP Status Code %s' % r.status_code)

    for line in r.content.split('\n'):
        line = line.strip()
        # Matches nginx and apache's autoindex formats
        match = re.match(r'^.*\<a.+href\=[\'\"]([^\'\"]+)[\'\"].*\>.*(\w{1,4}-\w{1,4}-\w{1,4})', line, flags=re.IGNORECASE)
        if match:
            if match.group(1).endswith('/'):
                dirs.append(match.group(1))

            elif match.group(1).lower().endswith(utils.image.SUPPORTED_EXTENSIONS):
                files.append(match.group(1))
    return (dirs, files)
Utility for parse_folder()
dataset/ETHPy150Open NVIDIA/DIGITS/tools/parse_folder.py/parse_web_listing