Develop Customizable Web Crawler Using WebSphinx

WebSPHINX是一款Java类库及交互开发环境,用于网页爬取和信息提取。它包括核心爬虫功能、用户界面实现及搜索接口调用等组件。用户可以定制下载参数如最大线程数、页面大小限制等。

WebSPHINX ( Website-Specific Processors for HTML INformation eXtraction) is a Java class library

and interactive development environment for web crawlers. As its home page's title, Websphinx is

aimed to be a personal , customizable Web crawler.

 

1 Package Overview

The architecture of Websphinx is quite straight forward.  As shown blow,

Figure1

the package websphinx contains the core function of the crawler.

websphinx.workbench implements the userinterface.

websphinx.searchengine has classes to call several search engines such as Google, Excite, etc.

Most of the search engine classifiers were written in 1998.  Search engines have changed the

format of their results many times since then, so the classifiers are out of date.

rcm.awt, rcm.util, org.apache.regexp are utility package. websphinx.workbench gets the graphical

support from rcm.awt. websphinx using PrioritizeQueue provided by rcm.util. org.apache.regexp

helps websphinx with pattern matching work.

 

2 Implement Your Own Crawler

Figure2

I suggest you focus on package websphinx and leave websphinx.workbench and

websphinx.searchengine behind, since it completely implements the funcion of the cawler.

Figure2 is inheritance diagram of package websphinx.

Class Crawler is the main class of the crawler. Pages are download in class Page. Class Access

provide the method that generate a connection to the server. Class es such asLinkPredicate,

PagePredicate, are used to decide whether the content should be visited or not. Pay attention to

DownloadParameters, which holds the configuration of downloading a page, like max threads, max

pagesize, download timeout, etc. You can add your configuration to it.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值