从博客文章中检测和提取文章内容/评论的最佳方法是什么
I have blog post (sample 1, sample 2). What is the best way to parse HTML and detect author, title, date, article content, comments (separately). Whole other content should be skipped.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您的博客网站有 RSS 提要,您可以使用 Java 的 SAX 解析器来浏览 XML
http://download.oracle.com/javase/1.4.2/docs/api/javax/xml/parsers/SAXParser.html
这是一个使用 SAX 解析 RSS 的示例解析器
http://javabeanz.wordpress.com/2007/07/25/rss-parser-sax/
Assuming your blogsite has an RSS feed, you can use Java's SAX Parser to whip through the XML
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
http://javabeanz.wordpress.com/2007/07/25/rss-parser-sax/
您可能无法获得所需的所有内容,但我认为 Boilerpipe 值得一看。
You may not get everything you are looking for but I think Boilerpipe is worth looking at.