#!/usr/bin/perl use warnings; use strict; use LWP::Simple qw(); use LWP::UserAgent; use HTML::Treebuilder; use HTTP::Request; use Data::Dumper; my $raw_html = LWP::Simple::get("http://www.perlmonks.org") || die + ("$!\n"); # print $raw_html; my $tree = HTML::TreeBuilder->new; $tree->parse($raw_html); $tree->eof; #$tree->dump; my @image_array = ($tree->look_down("_tag", "img")); foreach my $img (@image_array){ print "image src $img->{'src'}\n"; print "image width $img->{'width'}\n"; }
In reply to Re: Re: problems constructing an array of hashes
by Anonymous Monk
in thread problems constructing an array of hashes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |