title: Get text from the element
body: <p>I want to print the text of the <strong>span</strong> element ( Afghanistan ), but when I use the path of the <strong>span</strong> ( <code>//span[@class=‘mat-option-text’]</code> ), it prints the text of the <strong>mat-icon</strong> ( <em>warning</em> ) as well.</p>
  <p>Console:</p>
  <pre><code>Afghanistan warning
  </code></pre>
  <p>Can anyone help how I can print <em>Afghanistan</em> only?</p>
  <p><a href="https://i.stack.imgur.com/LHKHa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LHKHa.png" alt="enter image description here" /></a></p>