1.启动爬虫的命令为: scrapy crawl spidername(爬虫名)

2.我们还可以通过下述方式来启动爬虫

  步骤一:创建一个.py文件。startspider.py(这里文件的名称可以自己给定)

#!/usr/bin/env python
# -*- coding:utf-8 -*-
from scrapy import cmdline
# 方式一:注意execute的参数类型为一个列表
cmdline.execute('scrapy crawl spidername'.split())
# 方式二:注意execute的参数类型为一个列表
cmdline.execute(['scrapy', 'crawl', 'spidername'])

  步骤二:通过python startspider.py来运行此文件即可

 

相关文章:

  • 2022-02-09
  • 2022-01-13
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2021-07-18
猜你喜欢
  • 2021-09-11
  • 2021-09-24
  • 2021-08-28
  • 2021-05-31
  • 2022-12-23
  • 2021-04-03
  • 2022-12-23
相关资源
相似解决方案