Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Submitting form data to Javascript form

by Kanji (Parson)
on Mar 25, 2005 at 19:52 UTC ( #442398=note: print w/ replies, xml ) Need Help??


in reply to Submitting form data to Javascript form

Find out what cntyzip() actually does and rewrite your HTML as appropriate before form submitting.

$browser->get( $starting_url ); ## Reverse engineer cntryzip() here. my $html = $brwoser->content; $html =~ s/" onSubmit="cntyzip()"/cntyzip.cgi"/isg; ## Insert de-JS'd version here. $browser->update_html($html); $browser->form_name("GS"); $browser->submit();
Update: s/mech/browser/; # oops

    --k.



Comment on Re: Submitting form data to Javascript form
Download Code
Replies are listed 'Best First'.
Re^2: Submitting form data to Javascript form
by gebelo (Initiate) on Mar 28, 2005 at 21:09 UTC
    This is the solution I came up with, with the help of a friend.. it basically re-writes the form HTML and bypasses the Java script

    In this case, the original search was by county and $line = the value I pulled in from a list...

    my $form = $browser->form_name( 'formname' ); $form->action( 'https://destinationurl' ); $form->value( county => $line ); $browser->request( $form->click( 'buttonname' ) );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://442398]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (15)
As of 2015-07-28 20:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls