asp.net - Download a file from a WebForm using C# -
I need to download a file from a website (not written by me) I have a valid Username / password, and I can do it manually But I want to make it in an automated process (C #) to be downloaded from time to time.
Manually need to login to me, browse to the download page, select some combo box, and then click "Download". This link does a postback and returns the requested file.
I think the webclient me Download file should be used, but I can not understand how to pass all the required data and request postback properly. / P>
Is this another website API?
Otherwise, all you need to do is submit a web request, all the details in the description format, then read the feedback, then automatically fill the second form for "Check some combo box", and then finally file Read that response.
Alternatively, there is a browser emulation software, such as Selenium, which is used for website testing. You can install a test / script over there, which will do all of the above for you. I'm not sure how it handles downloaded files.
If you want to route 1, then be prepared to change your schedule every time other websites change. And if they add a captcha, then you get very bad.
Easily, will the password stored in any web browser save you from trouble?
Comments
Post a Comment