Praticamente ho creato questo codice per recuperare il sorgente della pagina ma non mi funziona:
codice:
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet(
"http://url?"+params);
r="";
HttpResponse response = client.execute(request);
BufferedReader rd = new BufferedReader(
new InputStreamReader(response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
String str = result.toString();
Dico non funziona perchè poi eseguendo:
codice:
Document doc = Jsoup.parse(str);
JSONObject json = new JSONObject();
List<JSONObject> list = new ArrayList<JSONObject>();
Element elementsTable = doc.getElementById("shortlist");
l'elemento shortlist che c'è perchè se tramite Browser visualizzo il sorgente, non lo trova..