2016-05-13 15 views

Antwort

1

Hier ist ein Beispiel für all Bild src und title Attribute lesen:

public class Test { 

    public static void main(String[] args) { 
     try { 
      Document doc = Jsoup.connect("http://www.golem.de/").get(); 
      Elements imageElements = doc.getElementsByTag("img"); 
      for (Element element : imageElements) { 
       System.out.println("src: "+element.attr("src")); 
       System.out.println("title: "+element.attr("title")); 
      } 
     } catch (Exception e) { 
      e.printStackTrace(); 
     } 
    } 
} 
+0

Vielen Dank flavio.donze half es mir sehr viel –