问题
i found an answer here:
code
for site in sites:
Link = site.xpath('a/@href').extract()
CompleteLink = urlparse.urljoin(response.url, Link)
yield Request(Link, callback = self.parseOneCar)
I got this exception
exceptions.NameError: global name 'Request' is not defined
what should I import please?
回答1:
Short answer: from scrapy.http.request import Request
Extended answer: read the docs.
来源:https://stackoverflow.com/questions/21121941/scrapy-python-request-is-not-defined