Hi All,
 
I'm having trouble narrow down the correct "<img" tag...
 
This piece of code will get ALL the "<img" tags: 
 
while (my $img_tag = $parser->get_tag('img')) {
  my $i = $img_tag->[1]; 
  my $code = $i->{'src'}; 
  print "$code\n"
 } 
 
All I want is the 11th one... so I tried to do a foreach (1..11) , very
unsucessful... :~)
 
Any suggestions would be greatly appreciated.... Here is the whole
script....
 
__begin__
 
#!/usr/bin/perl
 
use strict;
use warnings;
use HTML::TokeParser::Simple;
use LWP::Simple;
 
my $url = "
http://www.rcpworksmarter.com/rcp/products/detail.jsp?rcpNum=1013
<http://www.rcpworksmarter.com/rcp/products/detail.jsp?rcpNum=1013> ";
my $page = get($url) 
    or die "Could not load URL\n";
 
my $parser = HTML::TokeParser::Simple->new(\$page) 
    or die "Could not parse page";
 
while (my $img_tag = $parser->get_tag('img')) {
  my $i = $img_tag->[1]; # attributes of this img tag
  my $code = $i->{'src'}; 
   print "$code\n";
 }

__end__
 
Thanks!
 
Brian Volk
HP Products
317.298.9950 x1245
 <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
 
 

Reply via email to