Reputation: 91
how do i parse the image form the link inside the xml file url.when i parse the data it shows me the link besides showing image. here is the link of image http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png
and the link i an parsing data from
Upvotes: 0
Views: 781
Reputation: 3450
Here is the code to make a buffered image from the url.
try {
URL url = new URL("http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png");
BufferedImage bufferedImage = ImageIO.read(url);
ImageIO.write(bufferedImage, "png", new FileOutputStream("/home/visruth/OutputImage.png"));// A file named OutputImage.png will be created in the location /home/visruth/
} catch(Exception e) {
e.printStackTrace();
}
Upvotes: 1