我对scrapy很熟悉,我正在使用scrapy 0.14.4。我只想按照下面的例子打印标题和链接。
这是我的蜘蛛:
from scrapy.spider import BaseSpider
class XxxSpider(BaseSpider):
name = "xxx"
allow_domains = ["xxx.xxx.xxx"]
start_urls = ["http://xxx.xxx.com/jobs/"]
def parse(self, response):
for sel in response.xpath("//div[@id='job_listings']/a"):
title = sel.xpath('./text()').extract()
link = sel.xpath('./@href').extract()
print title, link
这里面少了什么?
目前没有回答
相关问题 更多 >
编程相关推荐