title: Scraping Data from a table with Scrapy
body: <p>I'm trying out Scrapy for first time. After doing fair bit of research I got the basics. Now I was trying to get data of a table. It isn't working. Check below for source codes.</p>
  
  <p><strong>items.py</strong></p>
  
  <pre><code>from scrapy.item import Item, Field
  
  class Digi(Item):
  
      sl = Field()
      player_name = Field()
      dismissal_info = Field()
      bowler_name = Field()
      runs_scored = Field()
      balls_faced = Field()
      minutes_played = Field()
      fours = Field()
      sixes = Field() 
      strike_rate = Field()
  </code></pre>
  
  <p><strong>digicric.py</strong></p>
  
  <pre><code>from scrapy.spider import Spider
  from scrapy.selector import Selector
  from crawler01.items import Digi
  
  class DmozSpider(Spider):
      name = "digicric"
      allowed_domains = ["digicricket.marssil.com"]
      start_urls = ["http://digicricket.marssil.com/match/MatchData.aspx?op=2&amp;match=1250"]
  
      def parse(self, response):
  
          sel = Selector(response)
          sites = sel.xpath('//*[@id="ctl00_ContentPlaceHolder1_divData"]/table[3]/tr')
          items = []
  
          for site in sites:
              item = Digi()
              item['sl'] = sel.xpath('td/text()').extract()
              item['player_name'] = sel.xpath('td/a/text()').extract()
              item['dismissal_info'] = sel.xpath('td/text()').extract()
              item['bowler_name'] = sel.xpath('td/text()').extract()
              item['runs_scored'] = sel.xpath('td/text()').extract()
              item['balls_faced'] = sel.xpath('td/text()').extract()
              item['minutes_played'] = sel.xpath('td/text()').extract()
              item['fours'] = sel.xpath('td/text()').extract()
              item['sixes'] = sel.xpath('td/text()').extract()
              item['strike_rate'] = sel.xpath('td/text()').extract()
              items.append(item)
          return items
  </code></pre>