On 01/01/2011 11:21, perl wrote:

Can any one tell why isn't this working on HTML::Tree ??

use strict;
use strict;
use warnings;
use YAML;
use HTML::Tree;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $response =
$ua->get('http://www.raaga.com/channels/hindi/moviedetail.asp?mid=H002927');
my $content1 = $response->content;
my $tree = HTML::Tree->new();
$tree->parse($content1);
my $article = $tree->look_down(_tag=>'form',id=>'raaga');
my $table =
$article->look_down(_tag=>'table',class=>'dataTbl',width=>"450");
print Dump $table;

Because the web page is mal-formed, and the best sense the parser can make of it puts that table outside the form you are searching.

- Rob

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to