在项目文件夹中可新建一个main.py的文件,目录结构如下代码
from scrapy.cmdline import execute
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
execute(["scrapy", "crawl", "tiebaspider"])#其中tiebaspider是我爬虫的名字,替换为你爬虫的名字即可
运行main.py文件。即可启动爬虫。