查看python镜像:
pip config list
如果为空的话,设置清华镜像:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
镜像地址:
安装scrapy:
如果python版本是3
就使用
pip3 install scrapy
如果是2
使用
pip install scrapy
安装结束后查看scrapy版本:
scrapy --version
scrapy项目开发流程:
创建项目:
结果展示:
创建爬虫:
1进入目录
2编写命令
目录结果:
编写代码:下载某一个首页:
根目录下运行:
根目录下出现一个文件: