jrhmpt01:/root/lwp/0526# cat a1.pl
use LWP::UserAgent;
use DBI;
use POSIX;
use Data::Dumper;
use HTML::TreeBuilder;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
$ua->agent("Mozilla/8.0");
use HTML::TreeBuilder::XPath;
$tree= HTML::TreeBuilder::XPath->new;
$tree->parse_file( "0526.txt");
my @pages=$tree->find_by_tag_name('input');
#@urlall除了包含每个类别的文章,还包含阅读排行里的文章
foreach (@pages) {
@titlepage = $_->attr('value');
foreach (@titlepage) {
if ($_){
根据input 标签取value属性的值
最新推荐文章于 2023-06-15 11:12:15 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)