<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<title>Programming a Spider in Java — Developer.com</title>
<meta name="description" content="This article shows how to use Java to create a spider. A reusable Spider class is provided, as well as an example program that scans a site for broken links.">
<meta name="keywords" content=" HTTP spiders java Hyperlink">
<meta name="authors" content=" Jeff Heaton">
<meta name="date" content="20030123">
<meta name="channel" content="">
<script language="JavaScript">
<!--
OAS_url = 'http://mjxads.internet.com/RealMedia/ads/';
OAS_sitepage = 'intm/webdev/www.gamelan.com';
OAS_listpos = 'house_ribbon,468x60-1,468x60-2,336x280,flex,336x280-2,120x60-1,120x60-2,120x60-3,125x125-1,125x125-2,125x800,accessunit,accessunit_one,accessunit_two,accessunit_three,ciu,cp1,cp2,cp3,cp4,cp5,cp6,cp7,cp8,cp9,cp10,cp11,cp12,cp13,cp14,fl1,fl2,fl3,fl4,fl5,send,morph';
OAS_query = '';
OAS_target = '_top';
OAS_version = 10;
OAS_rn = '001234567890'; OAS_rns = '1234567890';
OAS_rn = new String (Math.random()); OAS_rns = OAS_rn.substring (2, 11);
function OAS_NORMAL(pos) {
var_a=('<A HREF="' + OAS_url + 'click_nx.cgi/' + OAS_sitepage );
var_b=(var_a + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' );
var_c=(var_b+ OAS_query + '" TARGET=' + OAS_target + '>');
document.write(var_c);
var_aa=('<IMG SRC="' + OAS_url + 'adstream_nx.cgi/' + OAS_sitepage );
var_bb=( var_aa + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?');
var_cc=( var_bb + OAS_query + '" BORDER=0></A>');
document.write(var_cc);
}
//-->
</script>
<script language="JavaScript1.1">
<!--
OAS_version = 11;
if (navigator.userAgent.indexOf('Mozilla/3') != -1 )
OAS_version = 10;
if (navigator.userAgent.indexOf('Mozilla/4.0 WebTV') != -1)
OAS_version = 10;
if (OAS_version >= 11) {
var_aaa=('<SCRIPT LANGUAGE=JavaScript1.1 SRC="' + OAS_url);
var_bbb=(var_aaa + 'adstream_mjx.ads/' + OAS_sitepage + '/1');
var_ccc=(var_bbb + OAS_rns + '@' + OAS_listpos + '?' + OAS_query );
var_ddd=(var_ccc + '"><\/SCRIPT>');
document.write(var_ddd);
}
//-->
</script><script language="JavaScript1.1" src="Programming-a-Spider-in-Java_files/1441810592house_ribbon468x60-1468x60-2336x280flex336x280-2120.js"></script>
<script language="JavaScript">
<!--
document.write('');
function OAS_AD(pos) {
if (OAS_version >= 11)
OAS_RICH(pos);
else
OAS_NORMAL(pos);
}
//-->
</script>
<link href="Programming-a-Spider-in-Java_files/styles.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="Programming-a-Spider-in-Java_files/common.js"></script>
<script type="text/javascript" src="Programming-a-Spider-in-Java_files/tabs.js"></script>
<script type="text/javascript" src="Programming-a-Spider-in-Java_files/article_menu.js"></script>
<script type="text/javascript" src="Programming-a-Spider-in-Java_files/hot_topics.js"></script>
<script type="text/javascript" src="Programming-a-Spider-in-Java_files/iepngfix_tilebg.js"></script>
<style rel="stylesheet" type="text/css">
h2, h3, h4 { font-size: 1.2em; }
</style>
<script src="Programming-a-Spider-in-Java_files/newCaptcha.htm" type="text/javascript"></script></head><body><script src="Programming-a-Spider-in-Java_files/238801592.js" type="text/javascript"></script>
<!-- "send" begin" -->
<!------ OAS AD 'send' begin ------>
<script language="JavaScript">
<!--
OAS_AD('send');
//-->
</script><a href="http://mjxads.internet.com/RealMedia/ads/click_lx.ads/intm/webdev/www.gamelan.com/146290438/send/WMBrands/default/empty.gif/4f727368656b725063394541414f4946" target="_top"><img src="Programming-a-Spider-in-Java_files/4f727368656b725063394541414f4946_014.gif" alt="" border="0" height="1" width="1"></a>
<noscript>
<A
HREF="http://63.236.18.118/RealMedia/ads/click_nx.ads/intm/webdev/www.gamelan.com@house_ribbon,468x60-1,468x60-2,336x280,flex,336x280-2,120x60-1,120x60-2,120x60-3,125x125-1,125x125-2,125x800,accessunit,accessunit_one,accessunit_two,accessunit_three,ciu,cp1,cp2,cp3,cp4,cp5,cp6,cp7,cp8,cp9,cp10,cp11,cp12,cp13,cp14,fl1,fl2,fl3,fl4,fl5,send,morph!send"
>
<IMG
SRC="http://63.236.18.118/RealMedia/ads/adstream_nx.ads/intm/webdev/www.gamelan.com@house_ribbon,468x60-1,468x60-2,336x280,flex,336x280-2,120x60-1,120x60-2,120x60-3,125x125-1,125x125-2,125x800,accessunit,accessunit_one,accessunit_two,accessunit_three,ciu,cp1,cp2,cp3,cp4,cp5,cp6,cp7,cp8,cp9,cp10,cp11,cp12,cp13,cp14,fl1,fl2,fl3,fl4,fl5,send,morph!send"
border=0>
</A>
</noscript>
<!------ OAS AD 'send' end ------><!-- "send" end" -->
<div id="EntNetPlanet" class="wrapBody">
<!-- "house_ribbon" begin -->
<!------ OAS AD 'house_ribbon' begin ------>
<script language="JavaScript">
<!--
OAS_AD('house_ribbon');
//-->
</script><script type="text/javascript" src="Programming-a-Spider-in-Java_files/globaltoolbar-js.js"></script><script language="JavaScript" type="text/javascript">var isDOM=document.getElementById?1:0,isIE=document.all?1:0,isNS4=navigator.appName=='Netscape'&&!isDOM?1:0,isOp=self.opera?1:0,isDyn=isDOM||isIE||isNS4;function getRef(i,p){p=!p?document:p.navigator?p.document:p;return isIE?p.all[i]:isDOM?(p.getElementById?p:p.ownerDocument).getElementById(i):isNS4?p.layers[i]:null};function getSty(i,p){var r=getRef(i,p);return r?isNS4?r:r.style:null};if(!self.LayerObj)var LayerObj=new Function('i','p','this.ref=getRef(i, p); this.sty=getSty(i, p); return this');function getLyr(i,p){return new LayerObj(i,p)};function LyrFn(n,f){LayerObj.prototype[n]=new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px"; '+'with (this) { '+f+' }')};LyrFn('x','if (!isNaN(p)) sty.left=p+px; else return parseInt(sty.left)');LyrFn('y','if (!isNaN(p)) sty.top=p+px; else return parseInt(sty.top)');if(typeof addEvent!='function'){var addEvent=function(o,t,f,l){var d='addEventListener',n='on'+t,rO=o,rT=t,rF=f,rL=l;if(o[d]&&!l)return o[d](t,f,false);if(!o._evts)o._evts={};if(!o._evts[t]){o._evts[t]=o[n]?{b:o[n]}:{};o[n]=new Function('e','var r = true, o = this, a = o._evts["'+t+'"], i; for (i in a) {'+'o._f = a[i]; r = o._f(e||window.event) != false && r; o._f = null;'+'} return r');if(t!='unload')addEvent(window,'unload',function(){removeEvent(rO,rT,rF,rL)})}if(!f._i)f._i=addEvent._i++;o._evts[t][f._i]=f};addEvent._i=1;var removeEvent=function(o,t,f,l){var d='removeEventListener';if(o[d]&&!l)return o[d](t,f,false);if(o._evts&&o._evts[t]&&f._i)delete o._evts[t][f._i]}}function FSMenu(myName,nested,cssProp,cssVis,cssHid){this.myName=myName;this.nested=nested;this.cssProp=cssProp;this.cssVis=cssVis;this.cssHid=cssHid;this.cssLitClass='highlighted';this.menus={root:new FSMenuNode('root',true,this)};this.menuToShow=[];this.mtsTimer=null;this.showDelay=0;this.switchDelay=125;this.hideDelay=500;this.showOnClick=0;this.hideOnClick=true;this.animInSpeed=1;this.animOutSpeed=1;this.animations=[]};FSMenu.prototype.show=function(mN){with(this){menuToShow.length=arguments.length;for(var i=0;i<arguments.length;i++)menuToShow[i]=arguments[i];clearTimeout(mtsTimer);if(!nested)mtsTimer=setTimeout(myName+'.menus.root.over()',10)}};FSMenu.prototype.hide=function(mN){with(this){clearTimeout(mtsTimer);if(menus[mN])menus[mN].out()}};FSMenu.prototype.hideAll=function(){with(this){for(var m in menus)if(menus[m].visible&&!menus[m].isRoot)menus[m].hide(true)}};function FSMenuNode(id,isRoot,obj){this.id=id;this.isRoot=isRoot;this.obj=obj;this.lyr=this.child=this.par=this.timer=this.visible=null;this.args=[];var node=this;this.over=function(evt){with(node)with(obj){if(isNS4&&evt&&lyr.ref)lyr.ref.routeEvent(evt);clearTimeout(timer);clearTimeout(mtsTimer);if(!isRoot&&!visible)node.show();if(menuToShow.length){var a=menuToShow,m=a[0];if(!menus[m]||!menus[m].lyr.ref)menus[m]
Programming-a-Spider-in-Java.rar_Web site scan_broken links_spid
版权申诉
177 浏览量
2022-09-20
16:33:17
上传
评论
收藏 30KB RAR 举报
御道御小黑
- 粉丝: 58
- 资源: 1万+