注意:我是在root權限下運行下面的命令的,請根據自己的需要確定是否要在命令前面加上『sudo』以root身份運行~
首先安裝python= =
apt-get install python
然後安裝setuptools(一個python的設置工具。。)
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
然後安裝scrapy的各種支持庫
pip install w3lib
pip install twisted
pip install cssselect
pip install pyOpenSSL
apt-get install libxml2 libxslt python-lxml
安裝主角:scrapy
pip install scrapy
然後輸入scrapy
看看是否安裝成功:
正常的話得到以下類似信息:
Scrapy 0.22.0 – no active project
Usage:
scrapy <command> [options] [args]Available commands:
bench Run quick benchmark test
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[ more ] More commands available when run from project directory
Use “scrapy <command> -h” to see more info about a command