2012-03-23 1 views
0

어떻게 html 문자열에서 이미지 태그를 얻을 수 있습니까? http://www.newsonair.nic.in/writereaddata/news_pictures/PICST9197.jpg어떻게 HTML 이미지 태그 안드로이드를 얻을 수 있습니까?

누군가가 나에게이 작업을 수행하는 몇 가지 아이디어를 줄 안다면

,

감사 :

나는

<description><![CDATA[<p>23&nbsp;Mar&nbsp;2012</p><a href="http://newsonair.nic.in/news.asp?cat=State&amp;id=ST9197"><p style='FONT-SIZE: 12px; LINE-HEIGHT: 150%' align='justify'> <img style='FLOAT: left; MARGIN-RIGHT: 5px' height='80' width='80' src=http://www.newsonair.nic.in/writereaddata/news_pictures/PICST9197.jpg?0.533424></a><br> The West Bengal Budget for 2012-13 proposes an additional taxation of 200 crore rupees.The budget placed in the State Assembly by the Finance Minister Dr.</p><br clear="all" />]]></description> 

내가 혼자이 링크를하려면, 다음과 같이 설명을 얻고있다.

답변

3

가 여기에, 그것을 할 수있는 백만 가지 방법의 하나입니다

String url = htmlString.substring(htmlString.lastIndexOf("http"), htmlString.indexOf("jpg")+3); 

참조 :

String API

+0

'HTTP'이 보여주는 잘못된 구문 ... – Jeeva

+0

죄송 따옴표 단일하지 따옴표 . – Blundell

+0

@bundell : XML CDATA 태그를 파싱 한 것으로 알려진이 방식이 아닙니까? –

관련 문제