[Mechanize-users] form submit debugging

Rust, Jon jrust at lexus.elabor.com
Tue Oct 17 16:10:18 EDT 2006

Aaron Patterson wrote:
> If you set mechanize to log, it should log your request headers.  So
> just do this:
>   require 'logger'
>   agent = WWW::Mechanize.new { |a| a.log = Logger.new('mech.log') }
> You can also change the action on the form.  There is an action= method
> on the form, so you could just do this:
>   form.action = '/some_location'

Awesome! Thanks Aaron. Great s/w BTW.

OK, I've grabbed a couple of sessions via logging, and also via
sniffing. The only difference I've been able to find so far between
Firefox, Perl Mech and Ruby Mech is that the POST URL is encoded when
using Ruby Mech. Specifically, the '&' is represented as '&':

POST /page.aspx?cID=1234&ssID=ksdb...


POST /page.aspx?cID=1234&ssID=lpwioe...

Expected? If it matters, the content of the POST does not have '&'
encoded like this, just the URL provided in the initial POST.

Thanks again!

More information about the Mechanize-users mailing list