首页 文章

从Link标签读取数据并从描述中获取多个图像URL

提问于
浏览
0

1)我正在Android中制作RSS Feed应用程序 . 因此,在某些站点中,XML中的描述标记中没有足够的数据,但是有 <link> 标记包含该文章的整个数据 . 那么如何从该链接标签中读取数据 .

http://news.yahoo.com/rss/us

<item>
<title>
Police hold off on eviction of Los Angeles Occupy camp
</title>
<description>
<p><a href="http://news.yahoo.com/occupy-la-campers-brace-midnight-eviction-deadline-062954673.html"><img src="http://l2.yimg.com/bt/api/res/1.2/Tjy1MjbTLRHaXzGH5HEznA--/YXBwaWQ9eW5ld3M7Zmk9ZmlsbDtoPTg2O3E9ODU7dz0xMzA-/http://media.zenfs.com/en_us/News/Reuters/2011-11-28T230234Z_1_BTRE7AR1S0D00_RTROPTP_2_USA-PROTESTS.JPG" alt="photo" align="left" title="The Occupy Los Angeles encampment at City Hall Park is seen before the midnight deadline for eviction from City Hall Park passes in Los Angeles" border="0" /></a>LOS ANGELES (Reuters) - Police in riot gear closed in before dawn on Monday on anti-Wall Street activists in Los Angeles who defied a midnight deadline to vacate a camp outside City Hall, but stopped short of clearing the encampment. Police managed to reopen blocked streets for morning rush-hour commuters after a tense standoff with protesters who had taken over a downtown intersection, but remnants of a crowd that had swelled to 2,000 overnight remained at City Hall. ...</p><br clear="all"/>
</description>
<link>
http://news.yahoo.com/occupy-la-campers-brace-midnight-eviction-deadline-062954673.html
</link>

在上面的链接中,整个数据都在链接标记中 .

2)我可以在描述中从src在我的Feed应用程序中显示一个图像 . 但是,我怎么能显示两个以上的图像呢?我的意思是如何从 <description> 标签中保存数组中的图像链接?

http://feeds.feedburner.com/GameProVideoGameAnalysisNews?format=xml

<description>&lt;p&gt;Projections for 2011 make it look like Nintendo and Sony's handhelds together won't be able to touch the mobile phone market.&lt;/p&gt;&lt;p&gt;

&lt;div class="inlineImage center" style="width:590px;"&gt;

&lt;img src="http://cdn1.gamepro.com/article_img/gamepro/51225-224881-1.jpg?rand=D2B74567-BA30-957E-4B59D7FA5F9913FC" alt="Nintendo 3DS Continues To Lose " /&gt;
&lt;/div&gt;
&lt;/p&gt;    
&lt;p&gt;It's no secret that mobile phone gaming has seen a meteoric rise over the last few years, but it looks like the software sales trends are finally following suit. The chart above paints a pretty clear picture of Nintendo and Sony's loosening hold on portable game sales, and &lt;a href="http://blog.flurry.com/bid/77424/Is-it-Game-Over-for-Nintendo-DS-and-Sony-PSP"&gt;Flurry Analytics&lt;/a&gt; expects their share to fall to less than 50% by the end of the year.&lt;/p&gt;
&lt;p&gt;While Sony's fortunes are expected to change somewhat with Vita's release next year, it looks like gamers are sending a pretty clear message on where they want to spend their gaming dollars.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/GameProVideoGameAnalysisNews/~4/hc6MxVcn7T8" height="1" width="1"/&gt;</description>

我可以从描述中读取img的第一个src,但是如何从描述中读取所有img src ...

1 回答

  • 1

    为此,我已经给出了答案,你可以从那里检查并根据你的需要实现它 . 检查这个link . 希望这会帮助你 .

相关问题