0
Ich möchte Inhalte von einer Website abrufen, z. B. title
und src
Attribute der Bilder. Kann mir jemand dabei helfen?So extrahieren Bild URLs mit Jsoup
Ich möchte Inhalte von einer Website abrufen, z. B. title
und src
Attribute der Bilder. Kann mir jemand dabei helfen?So extrahieren Bild URLs mit Jsoup
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();
}
}
}
Vielen Dank flavio.donze half es mir sehr viel –