I'm not getting past printing to the screen and to a file the page in the script below but without the list of names in the middle. Without the if line I get an endless scroll. I want to be able to pull in all names and then isolate and print one (e.g. abercrombie). Guidance and actual script appreciated.

#!/bin/perl

use strict;

use WWW::Mechanize;

my $output_dir = "c:/training/bc";

my $starting_url = "http://clerk.house.gov/members/olmbr.html";;

my $browser = WWW::Mechanize->new();

$browser->get( $starting_url );

$browser->submit();

foreach my $line (split(/[\n\r]+/, $browser->content)) {
        
        if $ line =~ /abercrombie/

        print $browser->content;

}

 open OUT, ">$output_dir/simple2.html" or die "Can't open file:$!";

 print OUT $browser->content;

 close OUT;

close PAGE;





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to