1. scrapy安装(https://www.osgeo.cn/scrapy/intro/install.html)

建议直接使用anaconda安装,方便快捷,pip安装会遇到很多问题!!!!http://www.scrapyd.cn/doc/124.html

conda install -c conda-forge scrapy

提速可用:

conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'

conda config --set show_channel_urls yes

 修改:C:\Users\Administrator\ .condarc文件

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
show_channel_urls: true
ssl_verify: true

如果出现conda更新失败错误,试试这个:http://www.lqkweb.com/conda

上面我失败了,出现这个错误

Anaconda An HTTP error occurred when trying to retrieve this URL.HTTP errors are often intermittent

我改用的:(建议)

conda install scrapy

直接成功:

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_html

2. 框架结构

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_Python_02

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_ide_03

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_ide_04

3. 框架解析

3.1 Engine

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_ide_05

3.2 Downloader

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_框架解析_06

3.3 Spider(核心)

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_html_07

3.4 Spider Middleware

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_ide_08

4. request和scrapy对比

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_常用命令_09

 python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_常用命令_10

 python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_框架解析_11

5. scrapy常用命令

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_html_12 python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_html_13

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_Python_14

python爬虫笔记(七)网络爬虫之框架(1)——Scrapy爬虫框架(安装及坑)_框架解析_15