download a file from a public website with no logon required
    
    output = open(filename,'wb')
    output.write(request.urlopen(url).read())
    output.close()

def download_file_no_logon(url, filename):
    """
    download a file from a public website with no logon required
    
    output = open(filename,'wb')
    output.write(request.urlopen(url).read())
    output.close()    
    """
    import urllib.request
    #url = "http://www.google.com/"
    request = urllib.request.Request(url)
    try:
        response = urllib.request.urlopen(request)
        with open(filename,'wb') as f:
            #print (response.read().decode('utf-8'))
            f.write(response.read())
    except Exception as ex:
        lg.record_result("Error - cant download " + url + str(ex))