我正在使用Cocoapods中的MWFeedParser解析新聞RSS源。精美的作品。在RSS中處理HTML XML解析器
但是,當新聞項目的描述包含HTML(例如視頻嵌入)時,我不知道如何處理它。 Feed URL爲:DCI News Feed
以下是來自Feed的2條新聞。第一個是不會給我帶來麻煩的基本項目。第二個包含嵌入YouTube視頻的HTML。它使description屬性顯示原始文本。我想識別HTML並沒有顯示它,但是顯示HTML之後的實際描述(在這種情況下)。
沒有HTML:
<item>
<title>12 drum corps who celebrated Christmas in July</title>
<description>
It�s the time of year for festive lights, merry music, and great shopping deals in stores and online. As you get set to celebrate another holiday season, you might be surprised to find that sounds of the Christmas season have long been hea...</description>
<link>http://www.dci.org/news/view.cfm?news_id=5571dc79-6940-42e6-a435-b4893fccc133</link>
<news_date>2014-12-17T10:47:00-06:00</news_date>
</item>
HTML:
<item>
<title>2014 Open Class World Championship video sampler</title>
<description><div align="center"><iframe width="620" height="349" src="//www.youtube.com/embed/fBLPYhHatGg?list=PL-1dy9pmiSAS0Z0iTONfBIJOfoewGoCvI" frameborder="0" allowfullscreen></iframe></div>
The first corps to take the field during the Prelims competition...</description>
<link>http://www.dci.org/news/view.cfm?news_id=0a92bb20-9187-4689-ae92-fbe1a5a631f6</link>
<news_date>2014-12-17T01:24:00-06:00</news_date>
</item>