我是新來的boilerpipe。我試圖運行在其網站上給出的示例代碼:鍋爐起動器問題
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));
}
}
我添加了所有所需的jar文件到類路徑,但是我得到的異常:
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)
import java.net.URL; import de.l3s.boilerpipe.extractors.ArticleExtractor; import de.l3s.boilerpipe.extractors.DefaultExtractor; 公共類TESTURLBOILERPIPE { 公共靜態無效主要(字符串[] ARGES)拋出異常 { 最終網址URL =新的URL( 「http://www.l3s.de/web/page11g.do?sp = page11g&鏈路= ln104g&stu1g.LanguageISOCtxParam = EN「); System.out.println(ArticleExtractor .INSTANCE.getText(url)); } } – Zahran
@Zahran你如何開始你的'TESTURLBOILERPIPE'類?你在使用Eclispe,NetBeans還是其他IDE?或者您是否嘗試使用命令行啓動它(例如'java TESTURLBOILERPIPE')? – siegi