#!/usr/bin/perl -w # this code worked use strict; use WWW::Mechanize; my $url = 'http://www.bluffsdogs.com/agree.asp'; my $robot = new WWW::Mechanize; $robot->get($url); #$robot->form_number(''); #$robot->form_name(''); #$robot->set_fields('radiobutton' => 'true'); #$robot->click(); # Get the reply to my question my $html = $robot->content(); print "$html"; #### my $response = $browser->get($baseurl,@ns_headers); die "$baseurl error: ", $response->status_line unless $response->is_success; die "Weird content type at $baseurl -- ", $response->content_type unless $response->content_type eq 'text/html'; my $html = $response->content; # save all files that match pattern given - ignore case while( $html =~ m//ig ) { my $matchline = $1; #print "matchline = $matchline\n"; if($matchline =~ m/\"(.*?)\"/ig ) { $matchline=$1; $sawcount++; } # else keep what you have $savestr= URI->new_abs( $matchline, $response->base ); #print "savestr = $savestr\n"; if ($savestr =~ /$pattern/i ) {$savecount++;&storeurl($savestr,$trackname,$year)}; } print "I saw $sawcount URLs and thought $savecount where of interest.\n";