title: Having trouble with a scrapy script (selecting links)
body: <p>I am using Scrapy and am having trouble with the script. It works fine with the shell:</p>
  
  <p><code>scrapy shell "www.redacted.com"</code> I use <code>response.xpath("//li[@a data-urltype()"]).extract</code></p>
  
  <p>I am able to scrape 200 or so links from the page.</p>
  
  <p>Here is the code from the webpage I am trying to scrape:</p>
  
  <pre><code>&lt;a data-urltype="/view" data-mce-href="http://www.redacted.aspx?ID=xxxxxxxxxx" data-linktype="external" href="http://www.redacted.com/Home/wfContent.aspx?xxxxxxxxxxxxx" data-val="http://www.redacted.gov/Home/wfContent.aspx?xxxxxxxxxxxx" target="_blank"&gt;link text&lt;/a&gt;    
  </code></pre>
  
  <p>My problem is the script: (posted below) I know the <code>"a data-val"</code> is wrong.</p>
  
  <pre><code>import scrapy
  from ..items import LinkscrapeItem
  
  
  class Linkscrape(scrapy.Spider):
      name = 'lnkscrapespider'
      start_urls = [
          'https://www.redacted.com'
  
  
      ]
  
      def parse(self, response):
          items = LinkscrapeItem()
          links = response.xpath("a data-val").xpath.extract()
  
          for links in links:
              items['links'] = links
  
              yield{
                  'links': links
              }
  </code></pre>