kamike.collect 网络爬虫

程序名称:kamike.collect

授权协议: LGPL

操作系统: 跨平台

开发语言: Java

kamike.collect 介绍

Another Simple Crawler 又一个网络爬虫,可以支持代理服务器的翻墙爬取。

1.数据存在MysqL当中。

2.使用时,先修改web-inf/config.ini的数据链接相关信息,主要是数据库名和用户名密码

3.然后访问http://127.0.0.1/fetch/install 链接自动创建数据库

4.修改src\java\cn\exinhua\fetch中的RestServlet.java文件

   FetchInst.getInstance().running=true;

   Fetch fetch = new Fetch();

   fetch.setUrl("http://www.washingtonpost.com/");

    fetch.setDepth(3);

    RegexRule regexRule = new RegexRule();

    regexRule.addNegative(".*#.*");

    regexRule.addNegative(".*png.*");

    regexRule.addNegative(".*jpg.*");

    regexRule.addNegative(".*gif.*");

    regexRule.addNegative(".*js.*");

    regexRule.addNegative(".*css.*");

    regexRule.addPositive(".*PHP.*");

    regexRule.addPositive(".*html.*");

    regexRule.addPositive(".*htm.*");

    Fetcher fetcher = new Fetcher(fetch);

    fetcher.setProxyAuth(true);

    fetcher.setRegexRule(regexRule);

    List<Fetcher> fetchers = new ArrayList<>();

    fetchers.add(fetcher);
    FetchUtils.start(fetchers);


    将其配置为需要的参数,然后访问http://127.0.0.1/fetch/fetch启动爬取

    代理的配置在Fetch.java文件中:
    protected int status;

protected boolean resumable = false;

protected RegexRule regexRule = new RegexRule();
protected ArrayList<String> seeds = new ArrayList<String>();
protected Fetch fetch;

protected String proxyUrl="127.0.0.1";
protected int proxyPort=4444;
protected String proxyUsername="hkg";
protected String proxyPassword="dennis";
protected boolean proxyAuth=false;

5.访问http://127.0.0.1/fetch/suspend可以停止爬取

kamike.collect 官网

https://github.com/hubinix/kamike.collect

相关编程语言

Pacman 是一个软件包管理器, 作为 ArchLinux 发行版...
Smb4K 是KDE下的网络共享浏览器 更多屏幕截图请看:...
Wine (“Wine Is Not an Emulator” 的首字母缩写)...
虚拟桌面软件,可管理最多9个虚拟桌面,你可以用热键...
UNetbootin (Universal Netboot Installer)为一种跨...
Cobbler 可以用来快速建立 Linux 网络安装环境,它已...