Python mechanize - two buttons of type 'submit'

Posted by directedition on Stack Overflow See other posts from Stack Overflow or by directedition
Published on 2009-04-09T16:11:15Z Indexed on 2010/04/03 9:33 UTC
Read the original article Hit count: 367

Filed under:
|

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 for 'add attached file' and one for 'create'. Both are of type 'submit', and the attach button is the first one listed. So when I select the forum and do br.submit(), it clicks on the 'attach' button instead of 'create'. Extensive Googling has yielded nothing useful for selecting a specific button in a form. Does anyone know of any methods for skipping over the first 'submit' button and clicking the second?

© Stack Overflow or respective owner

Related posts about python

Related posts about mechanize