Aug-14-2018, 02:04 AM
Hi,
I'm trying to write a script to login to a corporate website to download reports. I already have the code in PowerShell but I would like to write the same in Python instead. Wonder if someone could point me in the right direction.
My main concern is to write a code that is secure - worry about password being stolen during the process.
thank you!
I'm trying to write a script to login to a corporate website to download reports. I already have the code in PowerShell but I would like to write the same in Python instead. Wonder if someone could point me in the right direction.
My main concern is to write a code that is secure - worry about password being stolen during the process.
Quote:$report_Date = "08/13/2018"
$pwd = Get-Content "c:\myfolder\crd.txt" | ConvertTo-SecureString
$crd = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "username",$pwd
$url = "https://randomcorporatewebsite&start=$report_Date&end=$report_Date&outFormat=csv"
$file = "C:\Download\download_rpt.csv"
Invoke-WebRequest -uri $url -Credential $crd -TimeOutSec 600 -UseBasicParsing -OutFile $file
thank you!