Either of these (tuned to your need) should do the trick. HTML::TokeParser::Simple or XML::LibXML.
use LWP::Simple qw( get ); use HTML::TokeParser::Simple; my $page = get(+shift || die "Gimme URI!\n"); my $p = HTML::TokeParser::Simple->new(\$page); while ( my $token = $p->get_tag("td") ) { next unless $token->get_attr("class") =~ /\bsomeClass\b/; my $first_child = $p->get_token(); print $first_child->as_is, $/; last; } use XML::LibXML; my $p = XML::LibXML->new; $p->recover_silently(1); my $doc = $p->parse_html_string($page); my ( $td ) = $doc->findnodes('//td[@class="someClass"]'); print $td->textContent, $/;
(update: rolled into single <code/> and fixed tag name.
In reply to Re: Please help with a fetching issue
by Your Mother
in thread Please help with a fetching issue
by mahira
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |