Eduardo Santizo
04/21/2021, 7:59 PMNoah K
04/21/2021, 8:03 PMjoin()
on the crawler)Eduardo Santizo
04/21/2021, 9:33 PMNoah K
04/21/2021, 9:33 PMEduardo Santizo
04/21/2021, 9:49 PMdef scrapy_solid(context):
# The path seen from root (ie. from Repo.py) for "settings.py"
settings_file_path = scrapy_proj_dir + "." + project + ".settings"
# Temporary environment variable that sets the scrapy settings path
os.environ.setdefault('SCRAPY_SETTINGS_MODULE', settings_file_path)
# Project settings for the spider
settings = get_project_settings()
# Instantiate the crawler process with the project settings
process = CrawlerProcess(settings)
# Override the "FEED_URI" parameter for the scraper (name of the output file)
crawler_class[i].custom_settings = {"FEED_URI": f"./{classNames[i]}_output.json"}
# Configure and start crawler instance with a spider passed in
process.crawl(crawler_class[i])
Thread(target=process.start).start()
yield scrapy_solid
Noah K
04/21/2021, 9:52 PMEduardo Santizo
04/21/2021, 9:58 PMNoah K
04/21/2021, 9:59 PMEduardo Santizo
04/21/2021, 10:10 PMjoin()
method do?Noah K
04/21/2021, 10:18 PMEduardo Santizo
04/21/2021, 11:11 PMNoah K
04/21/2021, 11:14 PMEduardo Santizo
04/21/2021, 11:18 PMMax Wong
04/22/2021, 1:34 PMEduardo Santizo
04/22/2021, 3:32 PMMax Wong
04/22/2021, 3:57 PMsensors
, so it should come in quite handyEduardo Santizo
04/22/2021, 4:29 PM