我想使用SyndFeedInput解析非标准提要
<entry>
<title>4 - Fleetmatics Group plc (0001526160) (Issuer)</title>
<link rel="alternate" type="text/html" href="http://www.sec.gov/Archives/edgar/data/1526160/000120919116115415/0001209191-16-115415-index.htm"/>
<summary type="html">
<b>Filed:</b> 2016-04-22 <b>AccNo:</b> 0001209191-16-115415 <b>Size:</b> 13 KB
</summary>
<updated>2016-04-22T21:07:34-04:00</updated>
<category scheme="http://www.sec.gov/" label="form type" term="4"/>
<id>urn:tag:sec.gov,2008:accession-number=0001209191-16-115415</id>
</entry>
我可以得到
title
,link
和updated
。但是不知道如何获取summary
和term in category
。while (itEntries.hasNext()) {
SyndEntry entry = (SyndEntry) itEntries.next();
String title = StringEscapeUtils.unescapeHtml3(entry.getTitle());
String link = entry.getLink();
Date datetime = entry.getUpdatedDate();
//Module summary = entry.getModule("summary");
System.out.println(title);
System.out.println(link);
System.out.println(datetime);
}
请指教!
最佳答案
您可以通过循环entry.getCategories()
访问的类别,并且摘要映射到entry.getDescription()
:
SyndFeed feed = ..
for (SyndEntry entry : feed.getEntries()) {
for (SyndCategory category : entry.getCategories()) {
System.out.println(category.getName()); // term
}
SyndContent summary = entry.getDescription();
System.out.println(summary.getValue());
}
关于java - Java SyndFeedInput解析提要,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36828557/