我正在尝试从 twitter atom/xml 提要中获取正确的数据。我在 txmldocument 中有 twitter 数据,并试图从中获取一些特定信息。
这是数据的截断示例:
<entry>
<link type="text/html" rel="alternate" href="http://twitter.com/blub/statuses/1501068" />
<title>title of twitter post goes here</title>
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/234870532/normal.jpg" />
</entry>
我遇到的问题是我正在尝试获取个人资料图片网址(第二个链接标签的 href 属性)。
如果我使用这样的代码:
i:=xmldocument1.DocumentElement.ChildNodes['entry'];
text:=(i.ChildNodes['link'].GetAttributeNS('href',''));
我得到的是第一个链接标签的 href 值,但我想要第二个链接标签,我不知道该怎么做。有人有什么想法吗?
谢谢。