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

后端 未结 5 1828
长情又很酷
长情又很酷 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:22

    Perhaps you want to try HttpUnit. Although written with testing of websites in mind it may be usable for your problem.

    From their website:

    "... Written in Java, HttpUnit emulates the relevant portions of browser behavior, including form submission, JavaScript, basic http authentication, cookies and automatic page redirection, and allows Java test code to examine returned pages either as text, an XML DOM, or containers of forms, tables, and links."

提交回复
热议问题