From: brabuhr@... Date: 2011-03-08T11:37:04+09:00 Subject: Re: Forms not seen by Mechanize (US Bank login) On 3/7/11, Phil Henley wrote: > I'm writing a script to login to my bank. Here's how the login > procedure works through a web browser: > > 1. enter and submit your username on the bank home page > 2. on a new page: answer a "Shield ID" question (a personalized > question) > 3. on a new page: enter your password > 4. on a new page: you now have access to your account info > > Using Firefox and the Live HTTP Headers add-on, I see that javascript > (or something??) is filling out various forms for me at each step which > takes me to the next page. Only one of these forms is visible to the > user in the browser at each step (login at step 1, and shield id at step > 2), javascript seems to be filling out the rest of the forms for the > user. > > In my script, I'm using Mechanize to manually fill out and submit all > these forms. > > This works fine until I get to Step 3 where you enter your password. > When I view the forms on this page with Mechanize only two forms show > up. The password form (as well as a few others) don't show up. * Perhaps there is a way to manipulate the DOM to add the missing form just like Javascript would? (There appears to be a Mechanize method to add a field to a form. [1]) * Perhaps there is a way to manually build the POST that would be generated from the form? * Try a different library like FireWatir or Celerity? [1] http://rdoc.info/github/tenderlove/mechanize/master/Mechanize/Form#add_field%21-instance_method