I'm looking for the main image which is in this div
<div id="imgTagWrapperId" >
<img src ="www.example.com">
</div>
I tried this :
Document document = Jsoup.connect(url).get();
Elements img = document.select("div[id=imgTagWrapperId] img[src]");
String imgSrc = img.attr("src");
The URL i'm working with is http://www.amazon.in/Google-Nexus-D821-16GB-Black/dp/B00GC1J55C/ref=sr_1_1?s=electronics&ie=UTF8&qid=1421161258&sr=1-1&keywords=Google
This worked for me :
Document document = Jsoup.connect(url).get();
Element img = document.getElementById("landingImage");
String imgSrc = img.attr("data-old-hires");
Document document = Jsoup.connect(url).get();
Elements img = document.select("img[id=landingImage]");
String imgSrc = img.attr("src");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.