你是否正在寻找关于heritrix的内容?让我把最直接的东西奉献给你:
heritrix作为一个比较经典的开源爬虫,写这篇文章目的是因为,3.X之后的heritrix的介绍以及配置的文章比较少了,。
heritrix 3.x 以后使用maven 2配置jar包引用,但是总是有好多包没法从maven库下载。所以,这里讲的环境搭建直接使用了编译好的工程来做,heritrix-3.2.0-dist.tar.gz以及源码压缩包heritrix-3.2.0-src.tar.gz
具体方法如下:
新建java工程(非maven)

将heritrix-3.2.0-dist.tar.gz解压放到工程目录

添加源代码引用,使用heritrix-3.2.0-src.zip:

尝试启动heritrix,heritrix内核使用jetty所以不需要依附tomcat或者其他web容器。
入口类是这个org.archive.crawler.heritrix


启动成功:
Oracle Corporation Java(TM) SE Runtime Environment 1.7.0_55-b13
Using ad-hoc HTTPS certificate with fingerprint...
SHA1:7C:99:FC:BC:62:13:DD:F3:B8:24:2F:EF:B7:60:0E:E2:AF:A1:13:8E
Verify in browser before accepting exception.
2014-07-11 01:54:31.408 警告 thread-1 org.archive.crawler.framework.Engine.findJobConfigs() invalid job directory: .\jobs\.gitignore where job expected from: .\jobs\.gitignore
2014-07-11 01:54:31.550:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
2014-07-11 01:54:31.552:INFO::jetty-6.1.26
2014-07-11 01:54:31.753:INFO::Started SslSocketConnector@localhost:9095
engine listening at port 9095
operator login set per command-line
NOTE: We recommend a longer, stronger password, especially if your web
interface will be internet-accessible.
heritrix version: 3.2.0
请求: https://localhost:9095/

现在可以正常使用了。
heritrix 3.2.0 dist 包下载见
以上就是关于heritrix的全部内容,相信你一定会非常满意。
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/shenmilingyu/article-4135-1.html
请不起灯光师