don’t include “https://“ in “allowed_domains" URLs.
Your XPath may be wrong, try ""//div[@class='tab-pane active']/table[@class='table table-bordered table-hover table-sortable’]//tr/td[1]/a/text()” (I didn’t test it) 在 2014年10月22日,下午2:47,Chetan Motamarri <[email protected]> 写道: > Hi, > > My goal is to extract all "SUBID" in https://steamdb.info/app/231670/subs/. > For this, I wrote following simple script but unable extract. Don't know > where it goes wrong. Please help > > 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) > titles = hxs.xpath("//div[@class='tab-pane > active']/table[@class='table table-bordered table-hover > table-sortable']/tr/td[1]/a/text()") > items = [] > > for link in titles: > item = SubItem() > item["ID"] = link.extract() > items.append(item) > return items > > > Its not working. I have attached the output screen I got, when I run it from > command prompt. There is no error in output screen :( I don't know where I'm > doing wrong > > > > > > > -- > 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. > <Capture.JPG> -- 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.
