def __crawl(self, spider_kwargs=None, settings=None):
"""
Perform a crawl based on the contents of self._crawling_config.
:param spider_kwargs: Keyword arguments to use to create a spider class.
:param settings: Scrapy settings to use to crawl the remote endpoint.
:return: None
"""
print("SPIDER KWARGS ARE %s." % (spider_kwargs,))
config.globals["%s-hostname" % (os.getpid(),)] = spider_kwargs["input_hostname"]
spider = self.get_spider_class_for_domain(**spider_kwargs)
process = CrawlerProcess(settings)
process.crawl(spider)
process.start()
评论列表
文章目录