use strict; use LWP::Simple; use HTML::TokeParser::Simple; #usage imglinker http://www.example.com my $url = shift; my $content = get ($url); my $p = HTML::TokeParser::Simple->new(\$content); my $in_anchor; while (my $t = $p->get_token){ if ($t->is_start_tag('a')){ $in_anchor++; next; } if ($t->is_start_tag('img') and $in_anchor){ my $src = $t->get_attr('src'); print $url."/"."$src\n"; $in_anchor = 0; } }
In reply to Re: Extracting full links from HTML
by Scott7477
in thread Extracting full links from HTML
by wojtyk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |