title: Extracting text from hyperlink using XPath
body: <p>I am using Python along with Xpath to scrape Reddit. Currently I am working on the front page. I am trying to extract links from its front page and display their titles in the shell.  </p>
  
  <p>For this I am using the Scrapy framework. I am testing this in the Scrapy shell itself.  </p>
  
  <p>My question is this: How do I extract the text from the <code>&lt;a&gt; ABC &lt;/a&gt;</code> attribute. I want the string "ABC". I cannot find it. I have tried the following expressions, but it does not seem to work.  </p>
  
  <p><code>response.xpath('//p[descendant::a[contains(@class,"title")]]/@value')</code> </p>
  
  <p><code>response.xpath('//p[descendant::a[contains(@class,"title")]]/@data')</code></p>
  
  <p><code>response.xpath('//p[descendant::a[contains(@class,"title")]]').extract()</code></p>
  
  <p><code>response.xpath('//p[descendant::a[contains(@class,"title")]]/text()')</code>      </p>
  
  <p>None of them seem to work. When I use <code>extract()</code>, it gives me the whole attribute itself. For example, instead of giving me <code>ABC</code>, it will give me <code>&lt;a&gt;ABC&lt;/a&gt;</code>.  </p>
  
  <p>How can i extract the text string?</p>