title: Using css selector in Selenium Webdriver with Ruby
body: <p>I have this code for which I am doing automation testing using ruby. </p>
  
  <pre><code>&lt;div class="class1 class2 class3 class4" style="padding: 4px;" id="_d4b99a9f-d1c8-4587-94e2-5ee95ebf1f76"&gt; 
      &lt;span class="class5" style="font-weight: bold; text-decoration: underline;"&gt;This is new TITLE&lt;/span&gt; 
      &lt;div class="class6" dd:contenttype="TEST CONTENT TYPE" dd:concept="TITLE" id="_7cfd6eed-fa15-42b8-81af-d09bf3cd4460"&gt;
       &lt;div class="class7"&gt; 
        &lt;div class="class8" dd:contenttype="TEST CONTENT" dd:entityid="0" dd:entityversion="0" id="_1c9125c4-b078-4017-a5ad-c48210e7090b"&gt; 
         &lt;div class="class9 class10" dd:btnfloatingstyle="top-right" dd:entitytexttype="resultval" id="_9c41159a-3a5b-4de1-87d2-e3361bd4d746" contenteditable="true"&gt;&lt;/div&gt; 
        &lt;/div&gt; 
       &lt;/div&gt;
      &lt;/div&gt; 
     &lt;/div&gt; 
  </code></pre>
  
  <p>I want to search the element using either 'This is new TITLE' or 'TITLE' for which I tried find_element with css selector and also with xpath but none seemed to work for me.</p>
  
  <pre><code>driver.find_element(:css, "span.class5") or `driver.find_element(:css, "div.class1 class2 class3 class4 span.class5")` 
  </code></pre>
  
  <p>Nothing seemed to work for me. Am I missing something?</p>