I have attached the link below, I use to run this link in google chrome, after that it will automatically start downloading CSV in the downloads folder with the default name "xxx.csv"
. I tried multiple codes to download the file and copy it to a specific location with a specific name but not achieved.
def download_files():
session = requests.session()
session.headers = {"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)"}
for idFile in report_files:
login = session.get(url, auth=HttpNtlmAuth('USER','PASSWORD'), verify=False)
Sample link: https://xxx.corp.xxcloud.net/exportdata/getdata?Format=CSV&QueryID=xxxx
.