PhpWiki - Image Extraction
Keywords: Image Extraction, PhpWiki

Image Extraction

This is very similar to link extraction. Instead of looking for LinkTag nodes you look for ImageTag nodes:

    import org.htmlparser.Parser;
    import org.htmlparser.util.ParserException;
    import org.htmlparser.Node;
    import org.htmlparser.tags.ImageTag;

    public class ImageDemo
    {
        public static void main (String[] args) throws ParserException
        {
            Parser parser = new Parser ("http://urlIWantToParse.com");
            Node [] images = parser.extractAllNodesThatAre (ImageTag.class);
            for (int i = 0; i < images.length; i++)
            {
                ImageTag imageTag = (ImageTag)images[i];
                System.out.println (imageTag.getImageURL ());
            }
        }
    }

| Page Execution took 0.258 seconds