Perl小说抓取脚本

#!/usr/bin/perl
use LWP::Simple;
use threads;
use Thread::Semaphore;

#先下载文件下来.
$k='321935'.'.html';
while( 1 ){
$url="http://xxx/Html/Book/0/549/$k";
$page=getstore($url,"$k");
  if($page=='200'){
     print "[*] $url_name[7] 下>
载成功! [*]\n";
     print "[*] 对文件进行分析处
理....[*]\n";
     open(FILE,$k);
     while(<FILE>){
       if(m#返回目录页</a><a class="prev" href="(.*)">下一页</a>#)
       {
         $k=$1;
         print "$k\n";
       }else{
         break;
       }
     }
     close(FILE);
  }
}

 这个脚本适合杰奇小说的那种框架!可以套着使用!

posted @ 2013-02-25 11:12  墨迹哥's  阅读(268)  评论(0编辑  收藏  举报