我在向爬虫添加关键字时遇到问题。我正在使用
scrapy
、flask
和 crochet
。函数是:
@crochet.run_in_reactor
def scrape_with_crochet(req):
eventual = crawl_runner.crawl(Spider, output_data = output_data,**req)
eventual.addCallback(finished_scrape,callbackKeywords = {'stash':5})
如何为
eventual.addCallback
添加关键字。我试过了eventual.addCallback(finished_scrape,callbackKeywords = {'stash':5})
和
eventual.addCallback(finished_scrape,cb_kwargs= {'stash':5})
但它们似乎都不起作用。