2012-04-08 71 views
0

我需要從網頁中提取主要的新聞內容。我在互聯網上搜索,發現一個名爲Boilerpipe的API免費提供用於此目的http://boilerpipe-web.appspot.com/但我不能找到任何使用Boilerpipe.java告訴我如何在Java中使用Boilerpipe來提取新聞內容,或者給我一些鏈接到使用Boilerpipe從新聞網頁中提取內容的java實現?如何使用Boilerpipe從網頁中提取新聞內容?

+0

你有求索紅色使用像Jsoup的圖書館? http://jsoup.org/你有一個特定的網站,你試圖刮? – 2012-04-13 19:35:33

回答

1

可能我的回答爲時已晚。但這很簡單。

URL url = new URL("http://www.nydailynews.com/sports/baseball"); 
ArticleExtractor ae = new ArticleExtractor(); 
String content = ae.getText(url); // this contains the final text 
1

簡單呵呵, 假設你需要提取此URL

只是用我的BoilerPipe替代Web API HERE, 我的服務是基於boilerpipe,我已經開發了這一點,因爲在獲得超過配額的錯誤原來application..you可以選擇取回結果的JSON,只是使用它在你的應用程序..

問候