【发布时间】:2020-08-02 22:37:02
【问题描述】:
我目前正在开发 python2.7/Scrapy 1.8 项目。 我在 Docker 容器中工作并使用
launchable.py:
import scrapy
from scrapy.crawler import CrawlerProcess
from spiders import addonsimilartechSpider, similartechSpider
process = CrawlerProcess()
process.crawl(similartechSpider.SimilarTechSpider)
process.crawl(addonsimilartechSpider.AddonSimilarSpider)
process.start()
我以前是这样开始我的scrapy的:
scrapy crawl <nameofmyspider> -o output.xlsx
我安装了scrapy-xlsx 并使用它直到现在,现在我有了我的launchable.py 我不知道如何通过scrapy crawler(而不是spider)传递“自定义”参数。 我了解scrapy设置和蜘蛛设置之间的区别,所以:
process.crawl(similartechSpider.SimilarTechSpider, input='-o', first='test1.xlsx')
可能无法正常工作?
感谢您花时间回答这个问题。
【问题讨论】:
标签: python-2.7 scrapy