关于爬虫:爬虫框架-Scrapy-的安装

4次阅读

共计 658 个字符,预计需要花费 2 分钟才能阅读完成。

Win 环境

1 查看本地的 python 版本:

python -V

Python 3.9.8(我本地是)

2 whl 形式装置 twisted

  • 1 因为 scrapy 须要 twisted 的环境,所以咱们间接去下载 whl 文件
    依据本人的 Python 版本在

    https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted

    抉择下载

  • 2 下载好后,Twisted‑20.3.0‑cp39‑cp39‑win_amd64.whl, 将这个文件寄存到 python 装置门路下的 script 文件夹中。
    如下:
  • 3 执行装置

    pip install twisted_iocpsupport-1.0.2-cp39-cp39-win_amd64.whl

    3 装置 scrapy

    pip install scrapy

4 装置 pywin32

pip install pywin32

5 查看是否装置胜利

scrapy startproject baidu baidu.com

显示相似如下,阐明 scrapy 曾经胜利装置

New Scrapy project 'baidu', using template directory 'D:\python398\lib\site-              
packages\scrapy\templates\project', created in:
  F:\test\baidu.com

You can start your first spider with:
  cd baidu.com
  scrapy genspider example example.com

Linux 环境

间接 执行 命令:

pip install scrapy
正文完
 0