scrapy python请求未定义

时间:2014-01-14 19:11:27

标签: python python-2.7 scrapy

我在这里找到了答案:

for site in sites:
            Link = site.xpath('a/@href').extract()
            CompleteLink = urlparse.urljoin(response.url, Link)
            yield Request(Link, callback = self.parseOneCar)

我得到了这个例外

exceptions.NameError: global name 'Request' is not defined

我应该导入什么?

1 个答案:

答案 0 :(得分:3)

简短回答:from scrapy.http.request import Request

扩展答案:阅读the docs