Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2016-06-25 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (323 votes). Check out past polls.