title: How to select a specific text using CSS selector
body: <p><a href="https://i.stack.imgur.com/AJ6J4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AJ6J4.png" alt="enter image description here" /></a></p>
  <p>I want to select the text &quot;Auto-Publish&quot; in Span. How can I do it with a CSS selector? with Xpath I know how to do it. I am using Nightwatch for UI automation. I want to make a generic function in the page object which will take a value as a parameter.</p>
  <pre><code>SelectFilterValue(value){
  
     .click(`//span[text()=&quot;${value}&quot;]`)  
   }
  </code></pre>
  <p>I can't do it like this since it's an XPath and I have to specify that it's an XPath. If it was a CSS selector I could do it since I don't have to specify that it's a CSS selector.  Or is there is any way that I can do it with Xpath too?</p>