<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          ContentExtractor網(wǎng)頁正文抽取算法

          聯(lián)合創(chuàng)作 · 2023-09-28 16:47

          簡介

          ContentExtractor 是一個開源的網(wǎng)頁正文抽取工具,用JAVA實現(xiàn),具有非常高的抽取精度。

          項目地址轉移

          項目已和WebCollector合并,當前項目為老版本ContentExtractor,請前往WebCollector項目查看ContentExtractor的最新版本源碼和API。

          教程(只適用于老版本,新版本請前往WebCollector)

          ContentExtractor的接口非常簡單,用戶可以根據(jù)網(wǎng)頁的url,或者網(wǎng)頁的html,來進行網(wǎng)頁正文抽?。?/p>

          根據(jù)url,抽取網(wǎng)頁的正文:

          public static void main(String[] args) throws Exception {
                  String content=ContentExtractor.getContentByURL("http://news.
                      xinhuanet.com/world/2014-11/02/c_127166728.htm");
                  System.out.println(content);
          }

          根據(jù)html,抽取網(wǎng)頁的正文:

          public static void main(String[] args) throws Exception {
                  String html="獲取到的html源碼";
                  String content=ContentExtractor.getContentByHtml(html);
                  System.out.println(content);
          }
          

          導入項目(只適用于老版本,新版本請前往WebCollector)

          從ContentExtractor的github主頁https://github.com/hfut-dmic/ContentExtractor上下載ContentExtractor-{版本號}-bin.zip,將解壓后得到的jar包全部放到工程的build path即可。

          ContentExtractor由合肥工業(yè)大學dmic團隊開發(fā)

          Git@OSC:http://git.oschina.net/webcollector/ContentExtractor

          瀏覽 21
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  日韩99视频 | 爱爱短视频电影无码免费 | 一区二区三区无码播放 | 五月婷婷久久综合 | 激情丁香婷婷 |