我有这个应该填写http://faceoook.com/recover.php上的电子邮件表格 ,如您所知,您可以通过电子邮件、姓名或电话号码进行搜索。所以我试图通过电子邮件搜索,并在搜索完成后获取该页面的内容以查看是否找到了配置文件,但代码似乎不起作用。
use HTTP::Request::Common;
use LWP::UserAgent;
$email="blabla\@hotmail.com";
my %data=(email=>$email);
my $user_agent = 'Mozilla/6.0';
my $Browser = LWP::UserAgent->new;
$Browser->agent($user_agent);
$ua=$Browser->post('https://www.facebook.com/recover.php',\%data);
if($ua->content=~/couldn\'t/){ #"couldn't" is part of the message displayed when
print "Not Found"; # input doesn't match
}
elsif ($ua->content=~/name/) {
print "Found";
}
else {
print "Not found";
}
$result=$ua->content;
open FILE,">","me.txt" or die $!;
print FILE $result;
close FILE;