Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUBMISSION OF FORM

Status
Not open for further replies.

Nashtrump1

Programmer
Joined
Sep 1, 2006
Messages
11
Location
GB
Hi There.

I am aware of how to submit a form using Perl by filling in the fields using Win32::IE::Mechanize module.

$ie->submit_form(
form_name => $form_name,
fields => {
username => 'yourname',
password => 'dummy',
},
button => $btn_name,
);

But i am trying to change data on a webpage and parse that data but the form is activated using an <OPTION> field.

Any idea how i do that?

Thanks

Nash
 
build a get request with the data you want in it, and submit to the server using LWP would be how I'd go about that

Any particular reason you're using the Win32::IE::Mechanize module, are there IE specifics about the site

the module on would be a good place to start if IE isn't a prerequisite



Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Im using IE because the site is using Javascript to generate the pages...

When the form is submitted a javascript function calls a sub to generate something.

Here is the code direct from the page.

<form name="bonavfrm" id="bonavfrm" action="/betting/index.asp" method="get">
<input type="hidden" name="sl" id="sl" value="" />
<input type="hidden" name="gi" id="gi" value="0" />
<select class="WCHhider" name="sltc" id="sltc" onchange="BN_Go(this)">
<option value="200252.2" selected="selected" >NFL Pre-Season Matches</option>
<option value="202728.2">CFL Coupon</option>
<option value="202729.2">B.C Lions @ Montreal Alouettes</option>
<option value="181347.2">Superbowl XLI</option>
<option value="199812.2">NFL Conferences</option>
<option value="199823.2">NFL Specials</option>
<option value="200587.2">NFL Regular Season Wins</option>
<option value="195431.2">CFL Grey Cup</option>
<option value="199730.2">NFL Divisions</option>
<option value="149826.2">Next Events Off</option>
</select>
<select class="WCHhider" name="slmtc" id="slmtc" onchange="BN_Go(this)">
<option value="cpnmtc1.1" selected="selected" >Game Lines</option>
</select>
<select class="WCHhider" name="sle" id="sle" onchange="BN_Go(this)">
<option value="502065.2">Tennessee Titans @ Green Bay Packers</option>
<option value="502066.2">Philadelphia Eagles @ New York Jets</option>
<option value="502067.2">Cincinnati Bengals @ Indianapolis Colts</option>
<option value="502068.2">San Diego Chargers @ San Francisco 49ers</option>
<option value="-1" selected="selected" > - All - </option>
</select>
<input type="submit" value="Go!" id="BNGo" name="BNGo" />
</form>

I tried to use mechanize to submit and retrieve forms but it didnt work!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top