title: python selenium click on button
body: <p>I am quite new to python selenium and I am trying to click on a button which has the following html structure:</p>
  
  <pre><code>&lt;div class="b_div"&gt;
  
      &lt;div class="button c_button s_button" onclick="submitForm('mTF')"&gt;
          &lt;input class="very_small" type="button"&gt;&lt;/input&gt;
          &lt;div class="s_image"&gt;&lt;/div&gt;
          &lt;span&gt;
             Search
          &lt;/span&gt;
      &lt;/div&gt;
  
      &lt;div class="button c_button s_button" onclick="submitForm('rMTF')" style="margin-bottom: 30px;"&gt;
          &lt;input class="v_small" type="button"&gt;&lt;/input&gt;
          &lt;span&gt;
                Reset
          &lt;/span&gt;
     &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>I would like to be able to click both the <code>Search</code> and <code>Reset</code> buttons above (obviously individually).</p>
  
  <p>I have tried a couple of things, for example:</p>
  
  <pre><code>driver.find_element_by_css_selector('.button .c_button .s_button').click()
  </code></pre>
  
  <p>or, </p>
  
  <pre><code>driver.find_element_by_name('s_image').click()
  </code></pre>
  
  <p>or, </p>
  
  <pre><code>driver.find_element_by_class_name('s_image').click()
  </code></pre>
  
  <p>but, I seem to always end up with <code>NoSuchElementException</code>, for example:</p>
  
  <pre><code>selenium.common.exceptions.NoSuchElementException: Message: u'Unable to locate element: {"method":"name","selector":"s_image"}' ;
  </code></pre>
  
  <p>I am wondering if I can somehow use the onclick attributes of the HTML to make selenium click?</p>
  
  <p>Any thoughts which can point me in the right direction would be great.
  Thanks.</p>