How to get my data from website so I can parse it?

This question already has an answer here:

  • Read/convert an InputStream to a String 56 answers

  • You can use this:

    BufferedReader reader = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); String parseThis = reader.readLine();

    That'll give you a string of the output. If it's in JSON, add:

    JSONObject jsonObj = new JSONObject(parseThis); JSONArray arrayOfStuff = jsonObj.getJSONArray(array_tag);

    链接地址: http://www.djcxy.com/p/13746.html

    上一篇: 8字节[]为字符串

    下一篇: 如何从网站获取我的数据,以便我可以解析它?