Lubuntu14.04(Ubuntu)安装爬虫框架Scrapy
来源:互联网 发布:淘宝店招是什么意思 编辑:程序博客网 时间:2024/06/04 17:43
准备工作
Python 2.5, 2.6, 2.7 (3.x is not yet supported)(一般Linux都会默认安装了Python2.7)
Twisted 2.5.0, 8.0 or above (Windows users: you’ll need to install Zope.Interface and maybe pywin32 because of this Twisted bug)
w3liblxml or libxml2 (if using libxml2, version 2.6.28 or above is highly recommended)
simplejson (not required if using Python 2.6 or above)
python-dev(很重要,否则在安装pyopenssl时会提示找不到Python.h)
pyopenssl (for HTTPS support. Optional, but highly recommended)
---------------------------------------------Twisted安装过程
sudo apt-get install python-twisted python-libxml2 python-simplejson
安装完成后进入python,测试Twisted是否安装成功
python-dev安装
apt-get install python-dev
pyOpenSSL安装
wget http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz#md5=767bca18a71178ca353dff9e10941929
tar -zxvf pyOpenSSL-0.13.tar.gz
cd pyOpenSSL-0.13
sudo python setup.py install
pycrypto安装
wget http://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.5.tar.gz#md5=783e45d4a1a309e03ab378b00f97b291
tar -zxvf pycrypto-2.5.tar.gz
cd pycrypto-2.5
sudo python setup.py install
$python
>>> import Crypto
>>> import twisted.conch.ssh.transport
>>> print Crypto.PublicKey.RSA
<module 'Crypto.PublicKey.RSA' from '/usr/python/lib/python2.5/site-packages/Crypto/PublicKey/RSA.pyc'>
>>> import OpenSSL
>>> import twisted.internet.ssl
>>> twisted.internet.ssl
<module 'twisted.internet.ssl' from '/usr/python/lib/python2.5/site-packages/Twisted-10.1.0-py2.5-linux-i686.egg/twisted/internet/ssl.pyc'>
如果出现类似提示,说明pyOpenSSL模块已经安装成功了,否则,请检查上面的安装过程(OpenSSL需要pycrypto)。
w3lib安装
首先安装python setuptool
sudo python-setuptool
然后
sudo easy_install -U w3libScrapy
wget http://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.14.3.tar.gz#md5=59f1225f7692f28fa0f78db3d34b3850
tar -zxvf Scrapy-0.14.3.tar.gz
cd Scrapy-0.14.3
sudo python setup.py install
Scrapy安装验证
经过上面的安装和配置过程,已经完成了Scrapy的安装,我们可以通过如下命令行来验证一下:
$ scrapyScrapy 0.14.3 - no active project
Usage:
scrapy <command> [options] [args]
Available commands:
fetch Fetch a URL using the Scrapy downloader
runspider Run a self-contained spider (without creating a project)
settings Get settings values
shell Interactive scraping console
startproject Create new project
version Print Scrapy version
view Open URL in browser, as seen by Scrapy
Use "scrapy <command> -h" to see more info about a command
至此Linux下Scrapy已安装成功了
开始学习爬虫了
在windows下安装一直不成功,郁闷啊,每次安装pyOpenSSL时都编译失败了,说缺少openssl/aes.h,网上找了很多方法都不行,安装OpenSSL也一直编译不成功,如果有人遇到同样的问题,希望能一起交流下- Lubuntu14.04(Ubuntu)安装爬虫框架Scrapy
- ubuntu下安装scrapy爬虫框架
- Ubuntu 12.04 安装Scrapy爬虫框架
- Python网络爬虫3 ---- ubuntu下安装爬虫框架scrapy
- 爬虫框架scrapy安装
- ubuntu14.04安装python爬虫框架Scrapy
- Ubuntu14.04中安装Scrapy爬虫框架
- <scrapy>python 爬虫框架scrapy安装
- 安装Twisted、Scrapy爬虫框架
- Kali 安装Scrapy爬虫框架
- Kali 安装scrapy爬虫框架
- Python爬虫框架Scrapy安装
- python爬虫框架scrapy安装
- Ubuntu安装 Scrapy框架
- 爬虫实践之爬虫框架Scrapy安装
- linux(ubuntu12.04)安装Twisted、Scrapy爬虫框架
- Python_Ubuntu 12.04 安装Twisted、Scrapy爬虫框架
- Python爬虫框架Scrapy实战之安装
- openfire后台密码错误的处理
- N^N 数字的最右边
- 从Code Review 谈如何做技术
- linux下面TCP套接口编程 client/server实例
- CF 478D - Red-Green Towers(DP)
- Lubuntu14.04(Ubuntu)安装爬虫框架Scrapy
- 机器学习算法之旅
- JQuery实现网页上时间动态显示
- FZU 2136 取糖果(线段树)
- 【JUnit4.10源代码分析】5.2 Rule
- 最佳加法表达式 dp
- 微信js api &.net动态转换json
- 学习OpenCV——Fast(特征点篇) (&DrawMatchFlags)
- 局