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