I'm attempting my first complicated scraping project and have hit a wall. To get at the data I want to scrape, I need to submit several forms first. I'm using www:mech and got through the first form easy:
$browser->get( $starting_url );
$browser->form_name("GS");
$browser->submit();
This takes me to a new page with another form -- but this one has a Javascript "onClick" routine, and when I try various permutations of the following, it doesn't accept my input:
This is the form code:
<form name="gs" METHOD="post" action="" onSubmit="cntyzip()" >
<table width=70% align="center">
<tr>
<td align=center colspan=2> You must either choose a <b>County <
+font
color="#FF0000"> or </font></b> enter a <b>Zip Code
+</b></td></tr>
<tr><td> </td></tr>
<tr>
<td colspan="2"> <table width = 76% align="center">
<tr>
<td width="16%" align=left><font size=2>County:</font></td
+>
<td width="30%" align=left><font size=2>
<select name="county">
<option value="">Choose a county</option>
<option value="01ATLANTIC">ATLANTIC</option>
And these are two of the methods I've attempted to get the thing to go:
$browser->form_name( "gs" );
$browser->set_fields(
county => '01ATLANTIC'
);
$browser->submit();
# $browser->form_name("gs");
# $browser->field( "county", "01ATLANTIC" );
# $browser->cntyzip();
I've tried this in both regular mech and the Win32::ie version, but no luck... Any advice?