Scrapy的安装与使用

一、安装scrapy

1.Linux环境

yum install python34-devel epel-release libxslt-devel libxml2-devel openssl-devel
pip install Scrapy -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

此处可能会有报错:

Download error on https://pypi.python.org/simple/incremental/: [Errno 97] Address family not supported by protocol -- Some packages may not be found!
    Couldn't find index page for 'incremental' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [Errno 97] Address family not supported by protocol -- Some packages may not be found!
    No local packages or working download links found for incremental>=16.10.1
......
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-bkql5v24/Twisted/

解决方法:

先安装incremental
pip install --upgrade incremental  -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
再安装scrapy就不会有报错了!

2.Windows环境

pip install Scrapy

二、使用scrapy

未完待续。。。

猜你喜欢

转载自www.cnblogs.com/sexyboy/p/8952009.html
今日推荐