Given this html sample :

```
<div class="measure-tab"> --- i want to select this one
  <span class="color_title">someText</span>
</div>
<div class="measure-tab"> --- i dont want to select this one
  <span class="color_title">someText</span>
  <div>
      <span class="qwery">jokerText</span>
  </div>
</div>
<div class="measure-tab"> --- i want to select this one
  <span class="color_title">someText</span>
</div>

```

I want to select the div that has @class='measure-tab' which has under it a span that as a specific class and text = someText and a nested span that has a specific class and does not contain text = 'jokerText', all this in an XPATH

What i've tried is :

```
//div[contains(@class, 'measure-tab') and //span[@class="color_title" and (contains(text(),'someText')) and //span[@class="color_title" and not(contains(text(),'jokerText'))]]

```

But this dosen't seem to work.
I also used [This](https://stackoverflow.com/questions/38942850/xpath-select-div-that-contains-class-and-whose-specific-child-element-contains) post as inspiration.

EDIT : Corrected bad description of what is the goal for this question

EDIT, made a new solution :

```
//div[contains(@class, 'measure-tab') and //span[contains(@class, 'color_title') and //span[not(contains(@class, 'qwery'))]]]

```

But this returns all the divs, instead of not matching it with --- i dont want to select this one

```
<span class="color_title">someText</span>
  <div>
      <span class="qwery">jokerText</span>
  </div>

```

I feel so close but yet so far, haha, it dosen't make sense for me why is it matching it with `<span class="qwery">jokerText</span>` when i wrote not contains there