I am trying to extract all the image url\'s from this webpage using jsoup? Can anyone offer help on how to do it? All the tags are formatted like this, but I only need the s
Supposing you already have the Element according to this IMG, try this:
String source = img.attr("src");
This attr method is inherited from Node class
HTH
You should be able to do something like this to get all img tags:
for (Element e : doc.select("img")) {
System.out.println(e.attr("src"));
}
This should select all img tags and then grab the src attribute and print to the console.
Document document = Jsoup.connect(" http://www.ncataggies.com/PhotoAlbum.dbml?DB_OEM_ID=24500&PALBID=417884").get();
Elements elements =document.getElementsByTag("IMG");
for(int i=0;i<elements.size();i++)
{
System.out.println("Sources of "+ i +":"+elements.get(i).attr("src"));
}