develooper Front page | perl.libwww | Postings from January 2001

help parsing HTML code

Thread Next
Andy Farrior
January 31, 2001 10:46
help parsing HTML code
Message ID:

I'm trying to read the following HTML code:

<input type="text" size="10" name="video_fec_errors_rx" value="24" READONLY>

I need to extract the value for video_fec_errors_rx.  I can't seem to 
figure out how to do it.  (This is the first time I've tried to use the LWP 

The web server I'm connecting to uses one form to display various values.

I think I need to use the HTML::Parse or HTML::TreeBuilder modules, but I 
get stuck really quick.

I know this a newbie question; so please be kind.


use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);


$URL = "http://$USERID:$PASSWORD\@$HOST/a_advannetstat.htm";

my $req = new HTTP::Request GET => $URL;
my $res = $ua->request($req);

if ($res->is_success) {
     $content = $res->content;
     print "$content\n";
} else {
     print "Can't reach $HOST\n";

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About