I remember you came here a while ago asking for advise on how to automatically parse online staff info html pages into useful data. How far are you into your project anyway? Did you experiment with the various CPAN modules mentioned in the replies to your original post?

Ok, I have written a demo using the following modules:
LWP::UserAgent ... to fetch the HTML source
HTML::Strip ... to strip HTML tags
use strict; use warnings; use LWP::UserAgent; use HTML::Strip; # fetch the html source my $ua = new LWP::UserAgent; my $req = new HTTP::Request (GET => 'http://www.ntu.edu.sg/eee/eee4/cv +/eekteoh.htm'); my $res = $ua->request($req); die "unable to fetch HTML source: $res->status_line" if !$res->is_success(); my $html = $res->content(); # fetch the html source $html =~ s/\x0D//g; # convert to unix format # grab the html fragments my ($research_interest, $selected_publications) = $html =~ /(Research Interests.*)(Selected Publications.*)Projects/s; # strip html tags my $hs = HTML::Strip->new(); $research_interest = $hs->parse( $research_interest ); $research_interest =~ s/\n+/\n/sg; $research_interest =~ s/(Research Interests)/$1\n------------------/; $selected_publications = $hs->parse($selected_publications); $selected_publications =~ s/\n+/\n/sg; $selected_publications =~ s/(Selected Publications)/$1\n-------------- +-------/; $hs->eof; print "$research_interest\n\n$selected_publications";

And the output -
Research Interests ------------------ Computer Vision and Pattern Recognition Autonomous Navigation of Outdoor AGVs Intelligent Systems Robotics Industrial Automation Selected Publications --------------------- DG Shen, Harace HS Ip, ....


In reply to Re: text extract by Roger
in thread text extract by shu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.