in reply to quite SOLVED Re^4: parsing html
in thread parsing html
This give you a string in $content that you can supply to $p->parse_content($content);.my $url3="http://microrna.sanger.ac.uk/blah/blah"; my $content=get $url3;
I only used the special perl <DATA> file handle for the purposes of the example (so I could easily get a string of HTML). You won't need to do this as that is what LWP::Simple's get gives you.
You need to use the regex on the text, so something like this might do it (untested):
Hope that helpsfor my $td (@tds){ my $bold = $td->look_down(_tag => q{b}); # look for a bold tag next unless $bold; my $txt = $bold->as_text; if ($txt=~ m/miR|let/){ print $txt, qq{\n}; # if there is one print the text } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: quite SOLVED Re^4: parsing html
by paola82 (Sexton) on May 15, 2009 at 10:19 UTC | |
by wfsp (Abbot) on May 15, 2009 at 11:00 UTC | |
by paola82 (Sexton) on May 15, 2009 at 11:26 UTC |