how to get url html contents to string in java

后端 未结 5 1867
北恋
北恋 2021-02-04 17:49

I have a html file stored on the server. I have the URL path something like this:

I want to rea

5条回答
  •  后悔当初
    2021-02-04 17:58

    import java.net.*;
    import java.io.*;
    
    //...
    
    URL url = new URL("https://localhost:9443/genesis/Receipt/Receipt.html");
    url.openConnection();
    InputStream reader = url.openStream();
    

提交回复
热议问题