最近根据需要,使用scrapy开发了一个爬虫应用,直接使用的python2,记录一下部署环境。
1.安装epel扩展源
yum -y install epel-release
2.安装pip
yum -y install python-pip
3.安装scrapy
pip install scrapy
阿里云镜像:pip install scrapy -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
4.若出现 command 'gcc' failed with exit status 1,gcc编译缺少模块
yum install gcc libffi-devel python-devel openssl-devel
5.未安装MySQLdb
yum install MySQL-python
6.若需定时脚本
crontab -e
案例:0 * * * * cd /wnet/pig && scrapy crawl price