title: NoSuchElementException: Message: no such element: Unable to locate element clicking span element using Selenium and Python
body: <p>I am trying to click on a span class located inside a div class. Here's the HTML:</p>
  <pre><code>&lt;div class=&quot;modal-content scrollbar&quot;&gt;
    &lt;div class=&quot;block block-always-show action-black-box waves-effect&quot;&gt;
      &lt;div class=&quot;icon xray-icon&quot;&gt;&lt;/div&gt;
      &lt;span class=&quot;txt&quot;&gt;Xray - Test Product Research&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Still learning Selenium but here's what I've tried:</p>
  <pre><code>driver.find_element_by_xpath(&quot;//span[contains(@class, txt) and contains(text()='Xray - Test Product Research')]&quot;).click()
  
  WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, &quot;//span[text()='Xray - Test Product Research']&quot;))).click()
  
  WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, &quot;//span[@class='txt' and contains(.,'Xray - Test Product Research')]&quot;))).click()
  </code></pre>
  <p>I am getting these errors:</p>
  <pre><code>NoSuchElementException: Message: no such element: Unable to locate element: 
  </code></pre>
  <p>and</p>
  <pre><code>TimeoutException: Message: 
  </code></pre>
  <p>Thanks in advance and appreciate any help on a solution.</p>