标签:.com new blog stat input pack net package style
package aaa; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; public class aaa { public static void main(String[] args) throws IOException { URL url = new URL("https://123.sogou.com/"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); StringBuilder build = new StringBuilder(); BufferedReader read = new BufferedReader(new InputStreamReader(conn.getInputStream())); String s; while ((s = read.readLine()) != null) { build.append(s + "\n"); } String html=build.toString(); } }
标签:.com new blog stat input pack net package style
原文地址:http://www.cnblogs.com/iwideal/p/6041264.html