title: Selenium - Select element based on multiple attributes via Xpath
body: <p>I did a google Search for the word 'Apple' using Selenium.</p>
  
  <p>Using the below xpath i am trying to get hyperlinks only if the search results that has the word 'Cupertino' in it. But it does return nothing!</p>
  
  <pre><code>//a[contains(.,'Apple') and //span/em[contains(.,'Cupertino')]]
  </code></pre>
  
  <p>Google Search Results Screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/4U62T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4U62T.png" alt="enter image description here"></a></p>
  
  <p>Can someone help me out with correcting the Xpath i used?</p>