谁能告诉我如何在带有 Netbeans 的 Windows 上使用锅炉管?如果您能给我一些 java 代码来开始它,我将不胜感激。
问问题
645 次
1 回答
0
尝试查看他们的Wiki和他们的QuickStart。下面的示例代码...
public static void main(final String[] args) throws Exception {
URL url;
url = new URL("http://www.example.com/some-location/index.html");
// NOTE We ignore HTTP-based character encoding in this demo...
final InputStream urlStream = url.openStream();
final InputSource is = new InputSource(urlStream);
final BoilerpipeSAXInput in = new BoilerpipeSAXInput(is);
final TextDocument doc = in.getTextDocument();
urlStream.close();
// You have the choice between different Extractors
// System.out.println(DefaultExtractor.INSTANCE.getText(doc));
System.out.println(ArticleExtractor.INSTANCE.getText(doc));
}
于 2012-04-09T12:20:36.623 回答