使用HTML标记解析CDATA并获取内容

时间:2015-04-23 19:59:45

标签: java android html dom xml-parsing

我正在解析RSS提要并获取描述标记,如下所示。

        <description><![CDATA[<img width="255" height="220" src="http://test.es/wp-content/themes/prime-theme/gbs-addons/advanced-thumbnail/timthumb.php?src=http://test.es/wp-content/uploads/2015/02/fd_prduct03.jpg&amp;w=255&amp;h=220&amp;zc=1&amp;s=0&amp;a=0&amp;q=89&amp;cc=0000000" class="attachment-gbs_voucher_thumb wp-post-image" alt="fd_prduct03" /><p><strong>€20.00</strong></p><p>Expires On: December 31, 1969 23:59:59<br/><span>0</span> buyers!<br/>Savings: 10%of full price</p>Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.Nam [&#8230;]]]></description>

现在我想从description元素中获取像imagelink,Savings,Expires On等元素。

我试过link1link2没有运气。

1 个答案:

答案 0 :(得分:0)

使用JSoup它是非常好的API