title: Selenium click on button by class name
body: <p>Hi I am new at using selenium and I am automating a certain process for my work. I have successfully been able to fill in forms and click on several buttons but when verifying my MFA, the button to verify doesn't work.</p>
  <p>HTML for button:</p>
  <pre><code>&lt;button class = &quot;btn blue trustdevice trustbtn&quot; onclick=&quot;updateTrustDevice(true)&quot;&gt; 
  &lt;span class =&quot;loadwithbtn&quot; style=&quot;display: none;&quot;&gt;&lt;/span&gt; 
  &lt;span class &quot;waittext&quot;&gt;Trust&lt;/span&gt; 
  &lt;/button&gt;
  </code></pre>
  <p>My code:</p>
  <pre><code>browser.find_element_by_class_name(&quot;btn blue trustdevice trustbtn&quot;).click() 
  </code></pre>
  <p>I receive this error
  selenium.common.exceptions.NoSuchElementException: Message: no such element:
  Unable to locate element: {&quot;method&quot;:&quot;css selector&quot;,&quot;selector&quot;:&quot;.btn blue
  trustdevice trustbtn&quot;}</p>
  <p>I also tried</p>
  <pre><code>elements = browser.find_element_by_class_name(&quot;btn blue trustdevice trustbtn&quot;)
  for e in elements:
  e.click()
  </code></pre>
  <p>but received the same error. Please let me know if any more info is required!</p>
  <p>EDIT:</p>
  <pre><code>button = browser.find_element_by_class_name(&quot;btn blue trustdevice trustbtn&quot;)
  </code></pre>
  <p>gives me the same error message as well.</p>