ltstudio 发表于 2015-12-28 08:33:40

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 下>
载成功!
[*]\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);
}
}

  这个脚本适合杰奇小说的那种框架!可以套着使用!
页: [1]
查看完整版本: Perl小说抓取脚本