in reply to WWW::Mechanize and submit button question

Since button text gets sent as a normal paremeter anyway, why not set it as a field and them submit it, rather than trying to click the button?
  • Comment on Re: WWW::Mechanize and submit button question

Replies are listed 'Best First'.
Re^2: WWW::Mechanize and submit button question
by srdst13 (Pilgrim) on Aug 09, 2005 at 13:19 UTC
    Thanks for the reply, but no go here, either. Just for my edification, why should the two methods be different?

    Sean

      Well, they shouldn't. I figured maybe they were doing something weird with buttons & clicks, but apparently not :( I spent some time on this problem, and I have experienced the same thing you have. It doesn't matter how I use Mech to submit the "Pick Primers" - it always spits out that error. I managed to find an older version of thier code (I can't find the currently running CGI, they have only released old ones). Here is the line:
      if ($query->param('Pick Primers')) { process_input($query); } else { confess "Did not see the 'Pick Primers' query parameter" }
      So it's nothing fishy, I think the encoding is wrong or something. Their form encoding says:

      enctype="x-www-form-urlencoded"

      I wonder if that has anything to do with it? I passed that as an HTTP header and it made no difference. I think the only solution here is to use a proxy to sniff what your browser is sending and then use the same proxy to sniff what Mech is sending and try to reconcile the two.

      Sorry I couldn't have been of more help.
        Thanks for the help and the time you spent on this. I suspected an encoding issue, also. I have the binary running locally--this was a project for a friend who is stuck using the web interface. He will need to bite the bullet and download the binary.

        Sean