Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Process a HTML file to get information from it.

by Griffler (Novice)
on Dec 11, 2006 at 19:06 UTC ( #589119=note: print w/replies, xml ) Need Help??


in reply to Re: Process a HTML file to get information from it.
in thread Process a HTML file to get information from it.

I tried your code and I got the following error.... Can't call method "right" without a package or object reference at C:\Change\2539\testit2.pl line 21. I modified the code to look like this:
use strict; use warnings; use HTML::TreeBuilder; my $root = HTML::TreeBuilder->new (); $root->parse_file ("c:\\change\\2539\\index.html"); for ($root->look_down ('_tag', 'a')) { my $href = $_->attr ('href'); next if ! $href; my $sib = $_->right ()->right (); my $number = $sib->as_text (); print "$href: $number\n"; }

Replies are listed 'Best First'.
Re^3: Process a HTML file to get information from it.
by chanio (Priest) on Dec 12, 2006 at 16:02 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://589119]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2016-12-04 23:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (70 votes). Check out past polls.