我正在寻找这个div中的主要图像
<div id="imgTagWrapperId" >
<img src ="www.example.com">
</div>
我试过了:
Document document = Jsoup.connect(url).get();
Elements img = document.select("div[id=imgTagWrapperId] img[src]");
String imgSrc = img.attr("src");
这对我有用:
Document document = Jsoup.connect(url).get();
Element img = document.getElementById("landingImage");
String imgSrc = img.attr("data-old-hires");
答案 0 :(得分:2)
Document document = Jsoup.connect(url).get();
Elements img = document.select("img[id=landingImage]");
String imgSrc = img.attr("src");