in reply to Re^2: Problem extracting an HTML table with Perl
in thread Problem extracting an HTML table with Perl
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Problem extracting an HTML table with Perl
by Sosi (Sexton) on Aug 11, 2014 at 17:56 UTC | |
by kennethk (Abbot) on Aug 11, 2014 at 18:22 UTC |