新建类时需导入settings文件
如下:
from scrapy.utils.projectimport get_project_settings
from scrapy.crawler import CrawlerProcess
crawler = CrawlerProcess(get_project_settings())
crawler.crawl(spidername)
crawler.start()
新建类时需导入settings文件
如下:
from scrapy.utils.projectimport get_project_settings
from scrapy.crawler import CrawlerProcess
crawler = CrawlerProcess(get_project_settings())
crawler.crawl(spidername)
crawler.start()