ShipMyPants has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks
I'm just getting started with PERL trying to use it to automate entering inventory requests on a web page at work. I've found and been fairly successful with WWW::Mechanize.
I've got everything working except the submit action of the automation. When looking at the HTML source , I see that the "onclick" attribute references a javascript function that simply validates some entries on the page and returns "true" or "false".
I understand (sorta) that I could either invoke an external javascript engine like spidermonkey or somehow provide the proper "true" response programmatically to make it "appear" the javascript ran and the form gets submitted. My understanding of how HTML forms are submitted and the overall interaction between the browser and the server is elementary at best.
Could someone help me understand if I'm thinking about this correctly and if there is a straightforward way for me to bypass the actual "click" of the button and submit the form directly via Perl/Mechanize?
Thanks in advance : ShipMyPants
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mechanize Javascript workaround?
by Corion (Patriarch) on Jul 19, 2013 at 21:24 UTC | |
|
Re: Mechanize Javascript workaround?
by thomas895 (Deacon) on Jul 19, 2013 at 23:03 UTC | |
by Anonymous Monk on Jul 22, 2013 at 15:30 UTC |