Python3 --- Scrapy安装

安装方式一:

如果使用的是PyCharm则File-->Settings-->Project Interpreter,选择绿色加号搜索Scrapy安装即可,如下图:

这里需要注意Manage Repositories可以配置成:

 

  • https://pypi.douban.com/simple/
  • http://mirrors.aliyun.com/pypi/simple/

 

安装方式二:

现在可以通过本地安装实现,安装步骤如下:

1、下载与系统对应的whl文件(下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/

2、通过pip install XXX.whl安装

 

在安装的过程中会遇到各种坑,列举如下:

坑一:

You are using pip version 9.0.1, however version 10.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

 

解决方法:

这里其实说的很明显,需要你升级pip执行python -m pip install --upgrade pip,这里要特别注意如果一旦执行中途出差,一定要删除已有的pip-10.0.1.dist-info

 

坑二:(我用的是python36,自己的错误信息忘记保存了,这里的错误信息是网上找的)

Command "d:\python\python27\python.exe -u -c "import setuptools, tokenize;__file
__='c:\\users\\admini~1\\appdata\\local\\temp\\pip-build-9gywq7\\Twisted\\setup.
py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\
n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\a
dmini~1\appdata\local\temp\pip-_jok3e-record\install-record.txt --single-version
-externally-managed --compile" failed with error code 1 in c:\users\admini~1\app
data\local\temp\pip-build-9gywq7\Twisted\

 

解决方法:

1、下载Twisted(下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/),注意下载的版本与环境一致即可

2、通过pip install TwistedXXX.whl安装

 

坑三:

万恶的Read Time Out

这个。。。。。。遇到了就只有喝杯咖啡,玩玩手机

 

参考资料:

 

Scrapy爬虫入门教程一 安装和基本使用 

Scrapy爬虫入门教程二 官方提供Demo 

Scrapy爬虫入门教程三 命令行工具介绍和示例 

Scrapy爬虫入门教程四 Spider(爬虫) 

Scrapy爬虫入门教程五 Selectors(选择器) 

Scrapy爬虫入门教程六 Items(项目) 

Scrapy爬虫入门教程七 Item Loaders(项目加载器) 

Scrapy爬虫入门教程八 交互式 shell 方便调试 

Scrapy爬虫入门教程九 Item Pipeline(项目管道) 

Scrapy爬虫入门教程十 Feed exports(导出文件) 

Scrapy爬虫入门教程十一 Request和Response(请求和响应) 

Scrapy爬虫入门教程十二 Link Extractors(链接提取器)

Scrapy爬虫入门教程十三 Settings(设置)

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值