having problems with urllib on a specific site so trying requests

def get_protected_page(url, user, pwd, filename):
    """
    having problems with urllib on a specific site so trying requests
    """
    import requests
    r = requests.get(url, auth=(user, pwd))
    print(r.status_code)
    if r.status_code == 200:
        print('success')
        with open(filename, 'wb') as fd:
            for chunk in r.iter_content(4096):
                fd.write(chunk)
        lg.record_result("Success - downloaded " + url)
    else:
        lg.record_result('network_tools.get_protected_page:Failed to downloaded ' + url + ' (status code = ' + str(r.status_code) + ')')