title: Capture Class Text - Selenium Python
body: <p>I'm trying to capture an element of a web page using selenium in python</p>
  
  <pre><code>&lt;span class="_2-1_O"&gt;&lt;span dir="auto" class="_1jlxc _3Whw5"&gt;Ana Smith&lt;/span&gt;&lt;/span&gt;
  </code></pre>
  
  <p>I'm trying to capture the name Ana Smith in Phyton:</p>
  
  <pre><code>nome_contato =  driver.find_elements_by_class_name("_1jlxc _3Whw5").text
  </code></pre>
  
  <p>However, python cannot locate</p>
  
  <pre class="lang-py prettyprint-override"><code>    try:
          name=  driver.find_elements_by_class_name("_1jlxc _3Whw5").text
  
      except Exception as e:
          print("|False")
  </code></pre>
  
  <p>Result: |False</p>