Can anyone tell me how to use boilerpipe on windows with Netbeans ? I'll be grateful if you can give me some java code to start with it.
Asked
Active
Viewed 652 times
1 Answers
0
Try to look at their Wiki and their QuickStart. Sample code below...
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));
}

Zack
- 5,108
- 4
- 27
- 39