Ryan Leavengood
1/9/2006 8:36:00 PM
Depending on what the JavaScript is doing, you may or may not need to
concern yourself with it. If it simply does validation, you can ignore
it, but just make sure your script submits valid data, since the
server probably assumes the data is valid if there is JavaScript
validation.
If the JavaScript does some processing and adds more information to
the form submission, then you will need to mimic this in your
Mechanize script.
But really, in the end, the form submission will always result in a
POST to the server, so overall you don't need to worry about the
JavaScript, just what kind of data the server expects to be posted.
If worse comes to worse you can always connect a transparent proxy to
see exactly what the web page is posting, and then mimic that. A
transparent proxy can be built in Ruby using WEBrick in a few lines.
Ryan