我想从Python运行Scrapy。我在看这个代码(source):Scrapy从Python运行
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy.settings import Settings
from scrapy import log
from testspiders.spiders.followall import FollowAllSpider
spider = FollowAllSpider(domain='scrapinghub.com')
crawler = Crawler(Settings())
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start()
reactor.run() # the script will block here
我的问题是,我如何调整这个代码来运行自己的蜘蛛困惑。我已经打电话给我的蜘蛛项目“spider_a”,它指定了要在蜘蛛本身内爬行的域。
我所问的是,如果我跑我的蜘蛛用下面的代码:
scrapy crawl spider_a
如何调整上面的例子Python代码做?
以此方式运行将忽略用户的设置。 – Medeiros