This is my html
<script src="/ClientScripts/swfobject.js" language="javascript" type="text/javascript"> </script>
<div class="contentDetails">
<div id="ctl00_MainContentPlaceHolder_ContentDetailsBodyDivision" class="body">
<div align="justify">
<p align="center"><img width="500" height="352" alt="MVM315" src="/UserUpload/Image/1(825).jpg" /></p>
<p align="center"><img width="500" height="352" alt="MVM315" src="/UserUpload/Image/2(598).jpg" /></p>
How can i get {src="/UserUpload/Image/1(825).jpg"
} with jsoup ?
I have this code but not working
Document doc = Jsoup.parse(html);
Elements mElements = doc.select("div[id^=ctl00_MainContentPlaceHolder_ContentDetailsBodyDivision]");
Result = mElements.get(0).tagName("img").toString();
try this:
Element imageElement = document.select("img").first();
String absoluteUrl = imageElement.absUrl("src"); //absolute URL on src
String srcValue = imageElement.attr("src"); // exact content value of the attribute.
More info here: http://jsoup.org/cookbook/extracting-data/working-with-urls
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With