Using proHTML to scrape images from URL
in
Contributed Library Questions
•
7 months ago
Noob here,
I'm able to scrape images from a URL using proHTML, but I want the original size of the images, not the reduced thumbnail.
I realize that the images on the URL are thumbnails - but it would be great to get the original size. Is this possible? Easy?
My Code:
import prohtml.*;
HtmlImageFinder htmlImageFinder;
int rand15 = int(random(1,15));
int rand30 = int(random(15,30));
int rand45 = int(random(30,45));
//insert your url here
htmlImageFinder = new HtmlImageFinder("http://film-grab.com/2010/07/06/2001-a-space-odyssey/");
PImage[] images = new PImage[htmlImageFinder.getNumbOfImages()];
println(htmlImageFinder.getNumbOfImages());
size(512,238*3);
try{
for(int i = 0;i<50;i++){
images[i] = loadImage(htmlImageFinder.getImageLink(i));
//images[i].resize(300,160);
println(htmlImageFinder.getImageLink(i));
}
image(images[rand15],0,0);
image(images[rand30],0,238);
image(images[rand45],0,238*2);
// }
}
catch (NullPointerException e) {
}
1