http://www.google.com/dictionary/json?callback=dic&q=keyword&sl=en&tl=en&restrict=pr%2Cde&client=teからすべての値を抽出しようとしてい ます
GSONを使いたいのですが、どうすればいいのかわかりません。
すべての値を単純に抽出できる jericohtml パーサーに似たものはありますか?
また、Javaを使用する必要があります。jsonを取得できますが、定期的にフォーマットされていません(行ごとに書かれていることを意味します)
ありがとう
URL u=new URL(url);
HttpURLConnection conn = (HttpURLConnection) u.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/atom+xml");
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 5.2; rv:21.0) Gecko/20100101 Firefox/21.0");
BufferedReader br=new BufferedReader(new InputStreamReader(conn.getInputStream()));
String temp=br.readLine();
String strJson=temp.substring("dic(".length(),temp.length()-",200,null)".length());
System.out.println(strJson);