use LWP::UserAgent;
use utf8;
use DBI;
$user="root";
$passwd="xxxxx";
$dbh="";
$dbh = DBI->connect("dbi:mysql:database=zjzc_vote;host=14.5.6.57;port=3306",$user,$passwd) or die "can't connect to database ". DBI-errstr;
$dbh->do("SET NAMES utf8");
use POSIX;
use Data::Dumper;
use HTML::TreeBuilder;
open DATAFH,">data.html" || die "open data file failed:$!";
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
$ua->agent("Mozilla/8.0");
my $response = $ua->get('https://licai.yingyinglicai.com/product/list.htm');
if ($response->is_success) {
print DATAFH $response->decoded_content; #
perl 爬取某理财网站产品信息
最新推荐文章于 2020-12-01 13:46:27 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)