Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Login to Corporate Website
#1
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.

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!
Reply


Messages In This Thread
Login to Corporate Website - by tkj80 - Aug-14-2018, 02:04 AM
RE: Login to Corporate Website - by micseydel - Aug-14-2018, 07:23 PM
RE: Login to Corporate Website - by tkj80 - Aug-15-2018, 02:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  in a login interface when i try login with a user supposed to say test123 but nothing NullAdmin 3 2,322 Feb-20-2021, 04:43 AM
Last Post: bowlofred
  Problem to use pip behind cntlm / corporate proxy markus7811 3 22,271 May-02-2018, 02:21 PM
Last Post: ljmetzger
  Login a Python Web Crawler on a ASP NET (.aspx) website p4t3x 1 7,058 Dec-01-2017, 11:09 AM
Last Post: hshivaraj

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020