Forum Discussion

PowerSheller's avatar
PowerSheller
Copper Contributor
Sep 23, 2021

Powershell downloads the login webpage html instead of a file

Hello

 

I have a website.com where I login via a form and it has a second step authentication too. After I fully login, a session starts and I can type a specific url in the address bar of IE/Edge and it will trigger a download of an xlsx file.

 

I want to get these files every 30 min and I was checking Powershell as other options are limited. However, using Invoke-WebRequest results in downloading the login webpage html instead of the file.

 

Any idea?

 

Also, do you know any other method to get these files regularly so that the session renews? It is impossible to automate the login as it requires a mobile phone. An API is paid so again it's not an option.

 

Also, tried a Data Connection in Excel but it does download the same html.

 

Thanks!

Resources