title: How can I select text in an element that isn't inside another element?
body: <p>I have a problem with some css selector (I have only one way to find an element if I use JS commands so only CSS selector is available for me)
  The page looks like this:</p>
  <pre><code>&lt;div class='test'&gt;
  some_text
  &lt;span&gt; some_other_text &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  <p>And I need to get some_text without getting &quot;some_other_text&quot;;
  I tried to use:
  <code>By.CssSelector(&quot;div[class='test'] :not(span)&quot;)</code> &gt;&gt; it returns all text;
  <code>By.CssSelector(&quot;div[class='test'] span:not(last-child)&quot;)</code> &gt;&gt; it returns only &quot;some_other_text&quot;;
  <code>By.CssSelector(&quot;div[class='test'] span:not(:last-child)&quot;)</code> &gt;&gt; it returns only &quot;some_other_text&quot;;
  <code>By.CssSelector(&quot;div[class='test']:not(:last-child)&quot;)</code>  &gt;&gt; it returns only &quot;some_other_text&quot;;</p>
  <p>is there any way to do what I need? could anyone help me , please?</p>