In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
< entries.size(); i++) { // 循环得到每个子项信息 if(index+1>RssTable.Rows.length) {break;} SyndEntry entry = (SyndEntry) entries.get (I); / * System.out.println ("title:" + entry.getTitle ()); System.out.println ("connection address:" + entry.getLink ()); SyndContent description = entry.getDescription (); System.out.println ("title introduction:" + description.getValue ()); System.out.println ("release time:" + entry.getPublishedDate ()) / / the following are the following parts of the Rss source: System.out.println ("title author: + entry.getAuthor ()); * / ci.adp.DataRow rssRow = rssTable.getDataRowByIndex (index); rssRow.setValue (" TITLE ", entry.getTitle ()); rssRow.setValue (" LINK ", entry.getLink ()); rssRow.setValue (" PUBDATE ", entry.getPublishedDate ()); rssRow.setValue (" SOURCE ", entry.getAuthor ()) / * / the category to which this title belongs is List categoryList = entry.getCategories (); if (categoryList! = null) {for (int m = 0; m)
< categoryList.size(); m++) { SyndCategory category = (SyndCategory) categoryList .get(m); System.out.println("此标题所属的范畴:" + category.getName()); } } */ index++; /* // 得到流媒体播放文件的信息列表 List enclosureList = entry.getEnclosures(); if (enclosureList != null) { for (int n = 0; n < enclosureList.size(); n++) { SyndEnclosure enclosure = (SyndEnclosure) enclosureList .get(n); System.out.println("流媒体播放文件:" + entry.getEnclosures()); } } */ } } catch (Exception e) { e.printStackTrace(); }org.dom4j.io.SAXReader saxReader = new org.dom4j.io.SAXReader();org.dom4j.Document document = saxReader.read(rssUrl);org.dom4j.Element channel = (org.dom4j.Element) document.getRootElement().element("channel"); int index =0; for (java.util.Iterator i = channel.elementIterator("item"); i.hasNext();){ if(index+1>RssTable.Rows.length) {break;} org.dom4j.Element element = (org.dom4j.Element) i.next (); String title = element.elementText ("title"); String link = element.elementText ("link"); String pubDate = element.elementText ("pubDate"); String source = element.elementText ("source"); ci.adp.DataRow rssRow = rssTable.getDataRowByIndex (index); rssRow.setValue ("TITLE", title); rssRow.setValue ("LINK", link); rssRow.setValue ("PUBDATE", pubDate) RssRow.setValue ("SOURCE", source); / * System.out.println ("title title:" + title); System.out.println ("link Link:" + link); System.out.println ("pubDate release time:" + pubDate); System.out.println ("source Source:" + source); * / index++ } this is the end of the article on "sample Analysis of parsing rss problems". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.