Created
February 9, 2024 04:21
-
-
Save SurendraTamang/377da1302dd83cb75266827d39f201f3 to your computer and use it in GitHub Desktop.
Running scrapy spider in python file using scrapy's cmdline module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scrapy import cmdline | |
from datetime import datetime | |
region = 'depew' | |
date_now = datetime.now() | |
# tslco is my scrapy spider and other arguments | |
cmdline.execute(f"scrapy crawl tslco -a db_connection={region} -o {region}-{date_now.strftime('%Y-%m-%d')}.csv".split()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment