If I run
I get the output#!/usr/local/bin/perl use strict; use warnings; use autodie; use Data::Dump; use HTML::Tree; use LWP::Simple qw(get); my $content=get('http://www.ncbi.nlm.nih.gov/genome/?term=Xylella_fast +idiosa'); my $tree = HTML::Tree->new(); $tree->parse($content); my $data =$tree->look_down( '_tag' =>'div', class => 'genome_descr' ); print $data->as_HTML;
If I run with<div class="genome_descr"><p><b>Submitter: </b><a href="http://aeg.lbi +.ic.unicamp.br/xf/" target="_blank">Sao Paulo state (Brazil) Consorti +um</a></div>
instead, I get 2 results. How does this compare for you?my @data =$tree->look_down( '_tag' =>'div', class => 'genome_descr' );
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re^3: Problem extracting an HTML table with Perl
by kennethk
in thread Problem extracting an HTML table with Perl
by Sosi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |