C# download files automatically from HTTPS redirects with login credentials

Is it possible to do the following automatically using C#?

  1. Login to a site https://knowledge.lelyonline.com/portal/ss/login

  2. go to another site https://knowledge.lelyonline.com/portal/app/portlets/results/view2.jsp?k2dockey=150319142108670

  3. this should auto redirect to a pdf or exe, then auto save the pdf or exe?

I tried to implement this to login and it seems to work but then I don't know what to do from there. (Logging in to an https site using C#)

Any guidance would be appreciated.

I keep getting error 500 with the following:

public void BrowserDownload(string url, CookieContainer cookies)
           WebClient sClinet = new WebClient();
           NetworkCredential myCredentials = new  NetworkCredential("username", "password");
           myCredentials.Domain = "domain";
           string sPath = @"C:\Temp\Test.exe";
           HttpWebRequest sHttpWebRequest = (HttpWebRequest) (WebRequest.Create(url));
         sHttpWebRequest.MaximumAutomaticRedirections = 3;
        sHttpWebRequest.AllowAutoRedirect = true;
        sHttpWebRequest.Credentials = myCredentials;
        HttpWebResponse sHttpWebResponse = (HttpWebResponse)sHttpWebRequest.GetResponse(); //error 500 here
        var flink = sHttpWebResponse.ResponseUri.ToString();
        sClinet.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DPCEA);
        sClinet.DownloadFileCompleted += new AsyncCompletedEventHandler(ACEA);
        sClinet.DownloadFileAsync(new Uri(flink), sPath);