# -*- coding: utf-8 -*-
import os
import sys

from scrapy.cmdline import execute

"""
    命令行启动：
    1、 Win CMD
        D:\dev\code\PythonCode\osc\spiders\MediaSpiders\.venv\Scripts\activate.bat
        scrapy crawl FacebookUserSpider -a params="{}"
        
    2、Windows PowerShell
        D:\dev\code\PythonCode\osc\spiders\MediaSpiders\.venv\Scripts\Activate.ps1
        scrapy crawl FacebookUserSpider -a params="{}"
"""

dirpath = os.path.dirname(os.path.abspath(__file__))

sys.path.append(dirpath)
# 等效于：scrapy crawl FacebookUserSpider -a params="{}"
execute(['scrapy', 'crawl', 'TwitterUserInfoSpider', '-a', 'params={}'])
