How do I login and download a file from a https web page from Java?

后端 未结 5 1816
长情又很酷
长情又很酷 2021-02-06 17:30

I have to login into a https web page and download a file using Java. I know all the URLs beforehand:

baseURL = // a https URL;
urlMap = new HashMap

        
5条回答
  •  感动是毒
    2021-02-06 18:10

    I'd say have a look at Java CURL http://sourceforge.net/projects/javacurl. I have used it before to login into an https website and download stuff, it has features such as spoofing the browser id etc. Which might solve your issue of getting redirected back to login.

    Although they provide an eclipse plugin for it I have used it without and it works fine.

    Alternatively you could use wget and call it from java.

提交回复
热议问题