So I was curious (new to Jsoup) if there is a way to pull every single piece of content (for example every image from the page)? I assume we would have to get the count of img src
and loop through, but I don't understand how to do this regardless of the page (ie I don't want to make it specific for only one page, so any URL I decide to crawl the program still works).
Here is my code, but the problem is it gets every 'alt' tag but not every 'src' tag (I'm using https://www.shutterstock.com/search/website as a test):
Document document = Jsoup.connect(url).get();
Elements idata = document.select("img");
for (Element e : idata) {
System.out.println("SRC: " + e.select("img").attr("src"));
System.out.println("ALT: " + e.select("img").attr("alt"));
}