#!/usr/bin/perl -w use strict; use LWP::Simple qw/ get /; use HTML::TokeParser; my $html = get('http://www.google.com/#googleholiday.pl'); my $p = HTML::TokeParser->new(\$html); my $t = $p->get_tag('img'); die $t->[1]->{alt}; __END__ #the one liner version #one perl -MLWP::Simple -MHTML::TokeParser -e"die HTML::TokeParser->new(\(g +et('http://www.google.com/#googleholiday.pl')))->get_tag('img')->[1]- +>{alt};" #two perl -MLWP::Simple -MHTML::TokeParser -e'die HTML::TokeParser->new(\(g +et("http://www.google.com/#googleholiday.pl")))->get_tag("img")->[1]- +>{alt};'
In reply to What holiday is today? <!-- googleholiday.pl --> by crazyinsomniac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |