參考[徐阿衡](http://www.shuang0420.com/2016/06/12/%E7%88%AC%E8%99%AB%E6%80%BB%E7%BB%93-%E4%BA%8C-scrapy/)的博客中爬蟲開發的內容。徐阿衡畢業于卡耐基梅隆大學,現就職于順豐科技。
[TOC]
這篇博客寫了有一段時間了,由于Scrapy版本更新,博客中有些代碼要更新一下。
[TOC]
我的機器配置:
`$uname -a`
`Linux a-All-Series 4.15.0-33-generic #36~16.04.1-Ubuntu SMP Wed Aug 15 17:21:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
`
[TOC]
安裝`python-scrapy`,結果很多坑,這里就不表有多少坑了。
[TOC]
看[Scrapy官方文檔](https://doc.scrapy.org/en/latest/intro/install.html),里面有這么一句話:
`Don’t use the python-scrapy package provided by Ubuntu, they are typically too old and slow to catch up with latest Scrapy.`
就是說,ubuntu不要安裝`python-scrapy`,我好悔啊......
[TOC]
官方文檔說,如果有安裝`anaconda`(剛好我有安裝),可以用`conda`安裝:
`conda install -c conda-forge scrapy`
執行完后,`scrapy`就安裝好了,是不是很簡單。
檢查一下`scrapy`的版本。是`v1.5.1`版本。
` import scrapy`
`scrapy.__version__`
`u'1.5.1'`