title: POST form with multiple submit elements
body: <p>Based on some quick examples found on SO and other sources, I am trying to use Python urllib/urllib2 to submit a form in the following manner:</p>
  
  <pre><code>&gt;&gt;&gt; import urllib, urllib2
  &gt;&gt;&gt; url = 'http://example.com'
  &gt;&gt;&gt; r_params = {'a':'test','b':'hooray'}
  &gt;&gt;&gt; e_params = urllib.urlencode(r_params)
  &gt;&gt;&gt; user_agent = 'some browser and such'
  &gt;&gt;&gt; headers = {'User-Agent': user_agent}
  &gt;&gt;&gt; req = urllib2.Request(url, e_params, headers)
  &gt;&gt;&gt; response = urllib2.urlopen(req)
  &gt;&gt;&gt; data = response.read()
  </code></pre>
  
  <p>I've gotten this to work, however, on the particular form I am looking for there are two buttons of type "submit". e.g.:</p>
  
  <pre><code>&lt;b&gt;&lt;input type="submit" name="ButtonA" value="SUBMIT"&gt;&lt;/b&gt;
  &lt;b&gt;&lt;input type="submit" name="ButtonB" value="LINK"&gt;&lt;/b&gt;
  </code></pre>
  
  <p>I believe the problem I'm having results from the current code choosing the wrong one. How do I get a response by submitting ButtonB rather than ButtonA? Some of the stuff I've read seems to indicate that I could try using mechanize, but I was hoping to keep this simple without having to read up and learn mechanize. Is there an easy way to do this, or do I need to suck it up and actually take the time to learn and understand what I'm doing?</p>