from scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings # 注意与scrapy.cfg在同一级目录 if __name__ == ‘__main__‘: process = CrawlerProcess(get_project_settings()) process.crawl(‘cn10010‘) process.start()
from scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings # 注意与scrapy.cfg在同一级目录 if __name__ == ‘__main__‘: process = CrawlerProcess(get_project_settings()) process.crawl(‘cn10010‘) process.start()