android - Extract image from URL using Jsoup -
I have tried to remove an image from other websites with the following code and I have no problem, but they have other websites Tried with and nothing happend came no image.
Secure voice downline background (Zero ... parameter) {Connect to web site {// Connect Document Document = Jsoup.connect (https: //www.indiegogo com / Project / Detective-cam-peek-me / embedded) .get (); // Use Elements to get the class data elements img = document.select ("div.i-project-card i-embedded img [src]"); // src attribute string imgSrc = img.attr ("src") find out; // image input image download image input = new java.net.URL (imgSrc) .openstream (); // decode bitmap bitmap = bitmapfender Aodestream; } Hold (IOException e) {e.printStackTrace (); } Return tap; }
Finally managed to capture y image.
image src Insert attribute data within a div such as source-
(& lt;) div class = "image" data- src = "image.jpg" gt;
gt; So I had to call the square of the divan and call it properties- src. The problem was that I did not know (& lt;) IMG & gt; The tag I was calling. So the last code elements img document.select ("div.image");
string imgSrc = img.attr ("data-source");
Cheers Everyone.
Comments
Post a Comment