public class Main extends Activity {
TextView liste1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
new Ara1().execute();
}
public class Ara1 extends AsyncTask<Void,Void,String> {
ProgressDialog dialog = new ProgressDialog(Main.this);
@Override
protected String doInBackground(Void... arg0) {
// TODO Auto-generated method stub
int i;
String result = "";
try {
Document document = Jsoup.connect("http://www.bilyoner.com/iddaa/hazir-kupon-detay?yazar=populer").get();
Elements element = document.select("li.iddaaTabsTab");
if (element.size() > 0) {
int x = element.size();
for (i = 0; i < x ; i++) {
result = result + element.get(i).text();
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return result;
}
@Override
protected void onPostExecute(String result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
liste1 = (TextView)findViewById(R.id.tv);
liste1.setText(result);
dialog.dismiss();
}
@Override
protected void onPreExecute() {
// TODO Auto-generated method stub
super.onPreExecute();
dialog.setMessage("Aranıyor...");
dialog.show();
}
}
When i connect this website "http://www.bilyoner.com/iddaa/hazir-kupon-detay?yazar=populer" and trying to parse, there is a problem that i couldnt get any data. I tried Jsoup on wikipedia and works great.
Also when i try this site on try jsoup it seems works without any problem.
Any help would be greatly appreciated.