15 Star 25 Fork 11

CrawlScript/ContentExtractor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
CrawlScript 提交于 2014-11-02 19:33 . 1.0

ContentExtractor

##简介 ContentExtractor是一个开源的网页正文抽取工具,用JAVA实现,具有非常高的抽取精度。

##算法 ContentExtractor的网页正文抽取算法使用的是CEPR,适用于几乎所有的包含正文的网页。 算法简介:http://dl.acm.org/citation.cfm?id=2505558

##教程 ContentExtractor的接口非常简单,用户可以根据网页的url,或者网页的html,来进行网页正文抽取:

根据url,抽取网页的正文:

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);
}

根据html,抽取网页的正文:

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

##导入项目 从ContentExtractor的github主页https://github.com/hfut-dmic/ContentExtractor上下载ContentExtractor-{版本号}-bin.zip,将解压后得到的jar包全部放到工程的build path即可。

##联系我们 欢迎加入讨论群:385105758

邮箱:wugq@hfut.edu.cn

##开发者 ContentExtractor由合肥工业大学dmic团队开发

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/webcollector/ContentExtractor.git
git@gitee.com:webcollector/ContentExtractor.git
webcollector
ContentExtractor
ContentExtractor
master

搜索帮助

Cb406eda 1850385 E526c682 1850385