ubuntu配置scrapy手記

注意:我是在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

CSS3的运算功能——calc()

以后 高度、宽度都可以运算了!对于我来说绝大部分使用JS的动机都不成立了~

具体语法: calc(expression);
比如:
#page {
width: calc(100% – 250px);}

※ 运算符前后要有空格隔开,否则语法错误.支持em,rem,%等等的单位

感觉超厉害,目前还需要使用私有前序使其生效2013-8-20