Java Code to get all images from html code

Java Code  to get all images from html code.

regex = Pattern.compile("[http]");
regexMatcher = regex.matcher(htmlParseData.getHtml());
List tr=htmlParseData.getOutgoingUrls();                      
          if(tr.get(i).toString().contains(".jpg") || tr.get(i).toString().contains(".jpeg") || tr.get(i).toString().contains(".gif") || tr.get(i).toString().contains(".bmp")){
                   url = new URL(tr.get(i).toString()); 
                   Image image = new ImageIcon(url).getImage();

Related Post

Web Crawler to get all images and emails from websites.

Subscribe to Java News and Posts. Get latest updates and posts on Java from
Enter your email address:
Delivered by FeedBurner
comments powered by Disqus