title: Python Mechanize Add Value to Form Input without ID or Name
body: <p>Have used mechanize before. Trying to fill out a form whose inputs have no name or id. They only have a class. Is there a way to do this maybe by number like you can do when selecting a form?</p>
  
  <pre><code>&lt;form class="go-action-form"&gt;
  
      &lt;div class="go-action-form-no-auth"&gt;
          &lt;input class="firstname" type="text" placeholder="First Name" data-required /&gt;
          &lt;input class="lastname"  type="text" placeholder="Last Name"  data-required /&gt;
          &lt;input class="email"     type="text" placeholder="Email"      data-required data-validation="email" /&gt;
          &lt;input type="submit" class="submit-petition" id="submit-petition-embed-ub39aca073fec49a690c5f3acb4152aae" value="Submit My Name" /&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is what I have.</p>
  
  <pre><code>br = mechanize.Browser()
  
  
  br.set_handle_equiv(True)
  br.set_handle_redirect(True)
  br.set_handle_referer(True)
  br.set_handle_robots(False)
  
  
  br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
  
  
  url = "https://generationopportunity.org/petitions/free-the-food-trucks-in-raleigh/?utm_content=bufferfa496&amp;utm_medium=social&amp;utm_source=twitter.com&amp;utm_campaign=buffer"
  br.open(url)
  
  br.select_form(nr = 1)
  
  br.form.set_value(firstname, nr=0)
  br.form.set_value(lastname, nr=1)
  br.form.set_value(email, nr=2)
  br.form.set_value(zip, nr=3)
  
  
  print br.form.controls[0]
  print br.form.controls[1]
  print br.form.controls[2]
  print br.form.controls[3]
  
  br.submit()
  </code></pre>
  
  <h1>EDIT</h1>
  
  <p>I figured out how to add values now in what i have above. Now i just can't figure out how to submit it. I try and it says br.submit() -- AttributeError: 'NoneType' object has no attribute 'click'</p>
  
  <p>Thanks</p>