import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;import org.json.JSONObject;public class Test04 { public static void main(String[] args) throws IOException {
        URL url=new URL("http://www.weather.com.cn/data/cityinfo/101010100.html");
        InputStream is=url.openStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
        StringBuilder sb = new StringBuilder();
        String lines;
        while ((lines = reader.readLine()) != null) {
         sb.append(lines);
        }
        reader.close();
        JSONObject json = new JSONObject(sb.toString());
        JSONObject array=json.getJSONObject("weatherinfo");
        System.out.println("城市:"+array.getString("city")+"\t"+"最高温度:"+array.getString("temp1")+"\t"+"最低温度:"+array.getString("temp2"));
       
}}