> Try This
>
#in your items.py
class SubItem(Item):
ID=Field()
Name=Field()
Billing_Type = Field()
Last_Updated = Field()
=============================================
#In your spider
__author__ = 'Sravan'
from scrapy.selector import Selector
from ExtractGames.items import SubItem
from scrapy.spider import BaseSpider
class GamePrice(BaseSpider):
name = "SUBID"
allowed_domains = ["https://steamdb.info"]
start_urls = ['https://steamdb.info/app/231670/subs/']
def parse(self, response):
hxs = Selector(response)
packs = hxs.xpath(".//div[@id='subs']/table/tbody/tr")
items = []
for pack in packs:
item = SubItem()
item["ID"]=pack.xpath('.//td/a/text()').extract()[0]
item["Name"]=pack.xpath('.//td[2]/text()').extract()[0]
item["Billing_Type"]=pack.xpath('.//td[3]/text()').extract()[0]
item["Last_Updated"]=pack.xpath('.//td[4]/text()').extract()[0]
items.append(item)
print item
return items
======================
with regards,
Sravan
--
You received this message because you are subscribed to the Google Groups
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.