0

I am new to boilerpipe. I tried to run sample code given on their website:

  import java.net.URL;
  import de.l3s.boilerpipe.extractors.ArticleExtractor;
  import de.l3s.boilerpipe.extractors.DefaultExtractor;

    public class TESTURLBOILERPIPE {
        public static void main(String[] arges) throws Exception 

    {

         final URL url = new URL(
                    "http://www.l3s.de/web/page11g.do?sp=page11g&link=ln104g&stu1g.LanguageISOCtxParam=en");
         ArticleExtractor ae = new ArticleExtractor();
            System.out.println(ae.INSTANCE.getText(url));
    }
}

I have added all the required jar files to the class path, however I get the exception:

Exception in thread "main" java.lang.IllegalArgumentException: usage: supply url to fetch
at org.jsoup.helper.Validate.isTrue(Validate.java:45)
at org.jsoup.examples.HtmlToPlainText.main(HtmlToPlainText.java:26)
Jay
  • 18,959
  • 11
  • 53
  • 72
Zahran
  • 419
  • 4
  • 10

2 Answers2

0

I don't know Boilerpipe, but are you sure you are trying to run the correct Java class? The stack trace looks like you are trying to run HtmlToPlainText (without arguments, thus the exception), but from the code you posted I think you would like to run your TESTURLBOILERPIPE class.

siegi
  • 5,646
  • 2
  • 30
  • 42
  • import java.net.URL; import de.l3s.boilerpipe.extractors.ArticleExtractor; import de.l3s.boilerpipe.extractors.DefaultExtractor; public class TESTURLBOILERPIPE { public static void main(String[] arges) throws Exception { final URL url = new URL( "http://www.l3s.de/web/page11g.do?sp=page11g&link=ln104g&stu1g.LanguageISOCtxParam=en"); System.out.println(ArticleExtractor .INSTANCE.getText(url)); } } – Zahran Sep 29 '12 at 14:49
  • @Zahran How are you trying to start your `TESTURLBOILERPIPE` class? Are you using Eclispe, NetBeans or some other IDE? Or have you tried to start it using the command line (e.g. `java TESTURLBOILERPIPE`)? – siegi Sep 29 '12 at 15:19
0

Try using a python wrapper. It takes care of all the dependencies, though you might have to install jpype manually (that source code is on sourceforge).

https://github.com/misja/python-boilerpipe

wle8300.com
  • 2,588
  • 1
  • 23
  • 29