How to get a image from just the webpages url in android

Viewed 58

I am making a app using google Fact Check API and and the response json is like this

{
  "claims": [
    {
      "text": "“President El-Sisi confirmed Egypt's unwavering strategic position on Libya, which aimed at restoring stability in the country, preserving its national institutions, and preventing further deterioration in Libya’s security situation via curbing illegal foreign interference in the Libyan issue.”",
      "claimant": "Abdel-Fattah al-Sisi",
      "claimDate": "2020-07-24T00:00:00Z",
      "claimReview": [
        {
          "publisher": {
            "name": "POLYGRAPH.info",
            "site": "polygraph.info"
          },
          "url": "https://www.polygraph.info/a/egypt-libya-sisi-intervention/30745850.html",
          "title": "Egypt's al-Sisi Told Trump Foreign Interference in Libya is Bad – Just as his Parliament Authorized him to Intervene",
          "reviewDate": "2020-07-24T00:00:00Z",
          "textualRating": "Misleading",
          "languageCode": "en"
        }
      ]
    }
  ],
  "nextPageToken": "CAE"
}

I want to know how can i get the urls image and display it like this image

I can't seem to figure out how to get the image as in the JSON there is only url of the webpage.

Edit:- Here is the code in which i am using GSON to store the values

JsonObjectRequest jsonObjectRequest = new JsonObjectRequest
                (Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
                    @Override
                    public void onResponse(JSONObject response) {

                        Log.i("response",response.toString());
                        Search search = gson.fromJson(response.toString(),Search.class);
                        Log.i("response",search.toString());
                        textView.setText("Claim:- "+search.claims.get(0).text+"\nFactual Rating:-"+search.claims.get(0).claimReview.get(0).textualRating);

                    }
                }, new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        Log.i("response",error.toString());// TODO: Handle error

                    }
                });
1 Answers

If you know the exact website you can use a web scraper. Look how you can do it here.

Related