I have a mechanize script written in python that fills out a web form and is supposed to click on the \'create\' button. But there\'s a problem, the form has two buttons. One fo
I can talk from experience using HTTP, rather than mechanize, but I think this is probably what you want.
When there are two submit buttons in a form, a server can determine which one was pressed, because the client should have added an argument for the submit button. So:
Will take you either the URL:
blah?button_1=One
or:
blah?button_2=Two
Depending on which button was pressed.
If you're programatically determining what arguments are going to be sent, you need to add an argument with the name of the submit button that was pressed, and it's value.