title: How to find and click the button by "onclick" with Selenium and Python?
body: <p>There are 2 buttons in a page, and the difference between these 2 buttons is <code>"onclick"</code>.</p>
  
  <pre><code>&lt;button class="btn btn-primary" style="width: 96px;" type="button" id="YesBtn" onclick="check_security('security_div0')"&gt;OK&lt;/button&gt;
  
  &lt;button class="btn btn-primary" style="width: 96px;" type="button" id="YesBtn" onclick="check_security('wlan1security_div0')"&gt;OK&lt;/button&gt;
  </code></pre>
  
  <p>I was thinking to use <code>xpath</code>:</p>
  
  <pre><code>driver.find_element_by_xpath("//form[@id='update-container-id']/div/div/div/div[2]/div/div[2]/table[1]/tbody/tr[1]/td[8]/div[3]/div/div/div/div[3]/button").click()
  </code></pre>
  
  <p>But it responses the error as below:</p>
  
  <pre><code>selenium.common.exceptions.ElementNotInteractableException: Message: Element &lt;button id="YesBtn" class="btn btn-primary" type="button"&gt; could not be scrolled into view
  </code></pre>
  
  <p>Does anyone can help me to click the 2nd button correctly? Thanks a lot.</p>