I am trying to use richtext to display html content so i was parse the url try to get all content inside <div class="margin-box"></div>
to String value.
But i can not parse the url.
Code like below:
User Soup parse the url
Document document = Jsoup.parse(news_url);
String news_content = CommonUtil.newsContent(document);
Data Capture
public static String newsContent(Document document){
Elements elements = document.select("div.margin-box");
String newsContent = elements.toString();
return newsContent;
}
Show URL parse unsuccessful. Actually i want to get value like below:
<div>
<p>
<imgsrc="http://p1.pstatp.com/large/1c67000332373537f0ff" img_width="640" img_height="360" inline="0" alt=“************” onerror="javascript:errorimg.call(this);">
</p>
<p class="pgc-img-caption”>***********</p><p>*************************************</p>
<p><imgsrc="http://p3.pstatp.com/large/1c6e0000841ab42ca326" img_width="640" img_height="425" inline="0" alt=“**********”onerror="javascript:errorimg.call(this);"></p>
<p class="pgc-img-caption”>********************************</p>
<p><img src="http://p1.pstatp.com/large/1c6d00008eebccce3e2f" img_width="550" img_height="375" inline="0" alt=“************” onerror="javascript:errorimg.call(this);"></p>
<p class="pgc-img-caption”>*********</p><p>**************************</p><p>*********************</p><p>*****************</p></div>
What did i do wrong?