Hi,
The page shows 3 forms, ( 2 for Search and one for language selection ).
You will first need to decide which form you want to use, and then issue
submit_form function with the fields you mentioned.

Something like below (untested! :) )

$browser->submit_form (
         form_number => 1,
         fields=> { keyword => 'OHIO' },
           button=> 'search' );


And yes, Read this: 
http://search.cpan.org/dist/WWW-Mechanize/lib/WWW/Mechanize.pm , 
Form methods section.

Hope this helps,
Dhanashri


>>>-----Original Message-----
>>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>>>Sent: Tuesday, April 11, 2006 4:00 AM
>>>To: beginners@perl.org
>>>Subject: Scraping Data Behind a Form
>>>
>>>I'm trying to scrape the data behind the form at
>>>http://www.theblackchurch.com/modules.php?name=Locator  As a true
>>>beginner
>>>with Perl (I know some php), I'm working from training scripts that
>>>scrape
>>> from another site.  There are four scripts of increasing complexity, but
>>>on the simplest I get error message "Can't call method "value" on an
>>>undefined value"  From reading, this looks like a cookie problem.  Here's
>>>the script I did:
>>>
>>>use strict;
>>>
>>>use WWW::Mechanize;
>>>
>>>my $output_dir = "c:/training/bc/";
>>>
>>>my $starting_url =
>>>"http://www.theblackchurch.com/modules.php?name=Locator";;
>>>
>>>my $browser = WWW::Mechanize->new();
>>>
>>>$browser->get( $starting_url );
>>>
>>>
>>>$browser->field( "church_state", "OH" );
>>>
>>>$browser->submit();
>>>
>>>print $browser->content;
>>>
>>>
>>>Ken
>>>
>>>
>>>--
>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>For additional commands, e-mail: [EMAIL PROTECTED]
>>><http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
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