#!/perl/bin/perl.exe
####################################
#author:make by skylway20130614
#useage:perl 138check.pl $number
#$number为电话号码
###################################
use strict;
use warnings;
use URI;
use Web::Scraper;
use Encode qw(encode decode);
my $file="C:/Users/Administrator/Desktop/mytest/web.log";
open(LOG ,">$file")||die "ERROR:cann't open $!";
my $number=$ARGV[0];
my $url = "";
my $proce = scraper {
process '.tdc1', "news[]" => "TEXT";
process '.tdc >td', "texts[]" => "TEXT"; };
my $res = $proce->scrape( URI->new($url) );
foreach my $result (@{$res->{news}}) {
$result=encode("gbk",$result);
$result=~s/\?//g;
print LOG "$result\n";
}
my @array;
foreach my $result (@{$res->{texts}}) {
$result=encode("gbk",$result);
$result=~s/\?//g;
push @array,$result;
print LOG "$result\n";
}
print "$array[5]\n";
阅读(1487) | 评论(0) | 转发(0) |