title: Get text content of an HTML element using XPath?
body: <p>See this html</p>
  
  <pre><code>&lt;div&gt;
      &lt;p&gt;
      &lt;span class="abc"&gt;Monitor&lt;/span&gt; &lt;b&gt;$300&lt;/b&gt;
      &lt;/p&gt;
      &lt;a href="/add"&gt;Add to cart&lt;/a&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;p&gt;
      &lt;span class="abc"&gt;Keyboard&lt;/span&gt; $20 
      &lt;/p&gt;
      &lt;a href="/add"&gt;Add to cart&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Using xpath I want to parse <code>Monitor $300</code> and <code>Keyboard $20</code>. I use this xpath</p>
  
  <pre><code> //div[a[contains(., "Add to cart")]]/p/text()
  </code></pre>
  
  <p>But it selects <code>&lt;span class="abc"&gt;Monitor&lt;/span&gt; &lt;b&gt;$300&lt;/b&gt;</code>. I don't want the tags. How do I get only the text?</p>