【发布时间】:2015-09-30 16:27:27
【问题描述】:
我正在使用以下代码从 python 脚本运行我的爬虫:
import scrapy
from scrapy.crawler import CrawlerProcess
process = CrawlerProcess()
process.crawl(MySpider)
process.start() # the script will block here until the crawling is finished
我的MySpider 返回一个对象。
如何从中获取返回值?请记住,这是 Scrapy 1.0。我找到的所有示例都是针对旧版本的 Scrapy。
以上代码来自:http://doc.scrapy.org/en/latest/topics/practices.html#run-scrapy-from-a-script
【问题讨论】:
标签: python scrapy scrapy-spider