简体   繁体   English

从博客文章中检测和提取文章内容/评论的最佳方法是什么

[英]What is the best way to detect and extract article content / comments from blog's article

I have blog post ( sample 1 , sample 2 ). 我有博客文章( 示例1示例2 )。 What is the best way to parse HTML and detect author, title, date, article content , comments (separately). 解析HTML并分别检测作者,标题,日期, 文章内容 ,评论的最佳方法是什么。 Whole other content should be skipped. 其他所有内容均应跳过。

您可能找不到想要的一切,但我认为Boilerpipe值得一看。

Assuming your blogsite has an RSS feed, you can use Java's SAX Parser to whip through the XML 假设您的博客网站具有RSS feed,则可以使用Java的SAX Parser来遍历XML。

http://download.oracle.com/javase/1.4.2/docs/api/javax/xml/parsers/SAXParser.html http://download.oracle.com/javase/1.4.2/docs/api/javax/xml/parsers/SAXParser.html

Here's an example of someone parsing an RSS using a SAX Parser 这是某人使用SAX解析器解析RSS的示例

http://javabeanz.wordpress.com/2007/07/25/rss-parser-sax/ http://javabeanz.wordpress.com/2007/07/25/rss-parser-sax/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM