Phil Phil - 6 months ago 10
Java Question

Get all Images from WebPage Program | Java

Currently I need a program that given a URL, returns a list of all the images on the webpage.

ie:

logo.png
gallery1.jpg
test.gif

Is there any open source software available before I try and code something?

Language should be java. Thanks
Philip

Answer

HtmlUnit has HtmlPage.getElementsByTagName("img"), which will probably suit you.

(read the short Get started guide to see how to obtain the correct HtmlPage object)