Osman krkmzlr
Osman krkmzlr
Gaziantep
09/03/2017 tarihinden beri üye
35 GY Puanı
67K GY Sırası

Kişisel Sayfaları

İlgi Alanları

1 Rozet
0 Sertifika
2 Soru Sordu
0 Cevap Verdi
0 Blog Yazısı
0 Etiket Takibi

Hakkında

İş Tecrubesi

Kullanıcıya ait İş tecrübesi bilgisi bulunmamaktadır.

Eğitim Geçmişi

Gaziosmanpaşa Üniversitesi
| Aralık 2020 - Aralık 2020

Sertifikalar & Başarılar

GY Sertifikaları (0)
Kullanıcının GY sertifikası bulunmamaktadır.
Diğer Sertifikaları (0)
Kullanıcıya ait sertifika bulunmamaktadır.
Test Sonuçları (0)

Kullanıcıya ait test sonucu bulunmamaktadır.

Dil Becerileri

Son Forum Aktiviteleri

2
Tümünü Gör

Json div[class yardım

protected Void doInBackground(Void... params) {
                try {
                    Document doc = Jsoup.connect(url).get();
                    Elements gazete = doc.select("div[class=ssPreview]");
                    Elements resim = gazete.select("img[src]");
                    resimurl = resim.attr("src");
                } catch (Exception e) {
                    e.printStackTrace();
                }

Yukarıda belirtigim kod giriş sayfasında belirttigim gazetenin herhangi birine tıklandıgında. o gazetenin sitedeki  büyük görselini çekmek istiyorum..  bu konuda yardımlarınızı bekliyorum.. Daha önce açtıgım konuda kodların tamamını verdim buradan inceleyebilirisiniz.. 

Veri çektigim site burda

kodlari inceledigimde full resim için Clas bu şekilde belirtilmiş div.imgFullPrevWrap

6 yıl 11 ay önce yanıtladın

Parser Sorunu Resimler görünmüyor

Merhaba arkadaşlar Json parser ile bir gazete sitesinden veri çekmek istiyorum Burdan siteye bakabilirsiniz.. Sadece bulunan bölgedeki bir kaç görseli denemek için tek tek parser ettim..uygulamayı açtıgımda bilgiler geliyor lakin görseller parser edilmiyor.Herhangi birine tıkladıgımda ise açiliyor fakat büyük olarak degil.. bu konu hakkına eksik oldugumu biliyorum yardımcı olmanızı rica ediyorum usulca kodları aşagıya bırakıyorum.. :)

görsel link burda;

public class AnaSayfa extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_anasayfa);
        TextView hurriyet_text= (TextView) findViewById(R.id.hurriyet_text);
        ImageView hurriyet_resim= (ImageView) findViewById(R.id.hurriyet_resim);
        String hurriyet_url="a[href=/gazete-mansetleri/hurriyet-gazetesi.html]";

        TextView sabah_text= (TextView) findViewById(R.id.sabah_text);
        ImageView sabah_resim= (ImageView) findViewById(R.id.sabah_resim);
        String sabah_url="a[href=/gazete-mansetleri/sabah-gazetesi.html]";

        TextView posta_text= (TextView) findViewById(R.id.posta_text);
        ImageView posta_resim= (ImageView) findViewById(R.id.posta_resim);
        String posta_url="a[href=/gazete-mansetleri/posta-gazetesi.html]";

        TextView haberturk_text= (TextView) findViewById(R.id.haberturk_text);
        ImageView haberturk_resim= (ImageView) findViewById(R.id.haberturk_resim);
        String haberturk_url="a[href=/gazete-mansetleri/haberturk-gazetesi.html]";

        TextView aksam_text= (TextView) findViewById(R.id.aksam_text);
        ImageView aksam_resim= (ImageView) findViewById(R.id.aksam_resim);
        String aksam_url="a[href=/gazete-mansetleri/aksam-gazetesi.html]";

        TextView vatan_text= (TextView) findViewById(R.id.vatan_text);
        ImageView vatan_resim= (ImageView) findViewById(R.id.vatan_resim);
        String vatan_url="a[href=/gazete-mansetleri/vatan-gazetesi.html]";

        TextView fanatik_text= (TextView) findViewById(R.id.fanatik_text);
        ImageView fanatik_resim= (ImageView) findViewById(R.id.fanatik_resim);
        String fanatik_url="a[href=/gazete-mansetleri/fanatik-gazetesi.html]";

        TextView fotomac_text= (TextView) findViewById(R.id.fotomac_text);
        ImageView fotomac_resim= (ImageView) findViewById(R.id.fotomac_resim);
        String fotomac_url="a[href=/gazete-mansetleri/fotomac-gazetesi.html]";


        LinearLayout hurriyet= (LinearLayout) findViewById(R.id.hurriyet);
        LinearLayout Sabah= (LinearLayout) findViewById(R.id.sabah);
        LinearLayout posta= (LinearLayout) findViewById(R.id.posta);
        LinearLayout haberturk= (LinearLayout) findViewById(R.id.haberturk);
        LinearLayout aksam = (LinearLayout) findViewById(R.id.aksam);
        LinearLayout vatan= (LinearLayout) findViewById(R.id.vatan);
        LinearLayout fotomac= (LinearLayout) findViewById(R.id.fotomac);
        LinearLayout fanatik= (LinearLayout) findViewById(R.id.fanatik);

        new Haberlerial(hurriyet_text,hurriyet_resim,hurriyet_url).execute();
        hurriyet.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent haberac=new Intent(AnaSayfa.this,GazeteAc.class);
                haberac.putExtra("gazeteurlsi", "http://www.gazeteoku.com/gazete-mansetleri/hurriyet-gazetesi.html");
                startActivity(haberac);
        });

        new Haberlerial(sabah_text,sabah_resim,sabah_url).execute();
        Sabah.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent haberac=new Intent(AnaSayfa.this,GazeteAc.class);
                haberac.putExtra("gazeteurlsi", "http://www.gazeteoku.com/gazete-mansetleri/sabah-gazetesi.html");
                startActivity(haberac);
            }
        });
        new Haberlerial(posta_text,posta_resim,posta_url).execute();
        posta.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent haberac=new Intent(AnaSayfa.this,GazeteAc.class);
                haberac.putExtra("gazeteurlsi", "http://www.gazeteoku.com/gazete-mansetleri/posta-gazetesi.html");
                startActivity(haberac);
            }
        });
        new Haberlerial(haberturk_text,haberturk_resim,haberturk_url).execute();
        haberturk.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent haberac=new Intent(AnaSayfa.this,GazeteAc.class);
                haberac.putExtra("gazeteurlsi", "http://www.gazeteoku.com/gazete-mansetleri/haberturk-gazetesi.html");
                startActivity(haberac);
            }
        });
        new Haberlerial(aksam_text,aksam_resim,aksam_url).execute();
        aksam.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent haberac=new Intent(AnaSayfa.this,GazeteAc.class);
                haberac.putExtra("gazeteurlsi", "http://www.gazeteoku.com/gazete-mansetleri/aksam-gazetesi.html");
                startActivity(haberac);
            }
        });
        new Haberlerial(vatan_text,vatan_resim,vatan_url).execute();
        vatan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent haberac=new Intent(AnaSayfa.this,GazeteAc.class);
                haberac.putExtra("gazeteurlsi", "http://www.gazeteoku.com/gazete-mansetleri/vatan-gazetesi.html");
                startActivity(haberac);
            }
        });
        new Haberlerial(fanatik_text,fanatik_resim,fanatik_url).execute();
        fanatik.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent haberac=new Intent(AnaSayfa.this,GazeteAc.class);
                haberac.putExtra("gazeteurlsi", "http://www.gazeteoku.com/gazete-mansetleri/fanatik-gazetesi.html");
                startActivity(haberac);
            }
        });
        new Haberlerial(fotomac_text,fotomac_resim,fotomac_url).execute();
        fotomac.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent haberac=new Intent(AnaSayfa.this,GazeteAc.class);
                haberac.putExtra("gazeteurlsi", "http://www.gazeteoku.com/gazete-mansetleri/fotomac-gazetesi.html");
                startActivity(haberac);
            }
        });
    }


    protected class Haberlerial extends AsyncTask<Void, Void, Void> {
        String alınangazeteadi,resimurl,ParseEdilecekGazeteUrlsi;
        TextView gazeteadi;
        ImageView resim;
        String url = "http://www.gazeteoku.com/gazete-mansetleri.html";

        public Haberlerial(TextView text, ImageView resim, String url) {
            this.gazeteadi=text;
            this.resim=resim;
            this.ParseEdilecekGazeteUrlsi=url;
            

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
        }
        @Override
        protected Void doInBackground(Void... params) {
            try {
                Document doc = Jsoup.connect(url).get();
                Elements gazetelerisec = doc.select("div[class=ssGList]");
                Elements gazeteyisec = gazetelerisec.select(ParseEdilecekGazeteUrlsi);
                Elements secilengazete = gazeteyisec.select("img[src]");
                resimurl = secilengazete.attr("src");
                alınangazeteadi= secilengazete.attr("alt");

            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }
        @Override
        protected void onPostExecute(Void aVoid) {

            gazeteadi.setText(alınangazeteadi);
            Picasso.with(AnaSayfa.this).load("http://www.gazeteoku.com"+resimurl).into(resim);
            
        }
    }

}

 

7 yıl önce yanıtladın