win64环境aishub数据爬虫配置方案
Python 3.6.1
- 下载地址:python-3.6.1-amd64.exe
- 系统需求:64位/32位
- 备注:python需加入系统path,并能够以python链接到
Mongodb 3.4.4
- 下载地址:mongodb-win32-x86_64-2008plus-ssl-3.4.4-signed.msi
- 系统需求:64位
- 安装位置:C:\mongoDB3.4.4
- 系统path:C:\mongoDB3.4.4\bin
- 配置文件位置:C:\mongoDB3.4.4\bin\mongodb.config
- config文件内容:
数据库文件目录: dbpath=C:/mongoDB3.4.4/data
日志目录: logpath=C:/mongoDB3.4.4/log/mongo.log diaglog=3
- 安装服务至系统服务
1 | mongod –config C:\mongoDB3.4.4\bin\mongodb.config –install |
- 启动与关闭mongoDB:
1 | net start MongoDB |
- 查看aishub数据库状态命令:
1 | mongo |
- 数据导出命令(默认csv格式):
1 | mongoexport -d aishub -c sheet1 -o c:\data.csv |
- 数据集合(sheet1)删除
1 | use aishubdb.sheet1.drop() |
Python 依赖包
Pip 国内源
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣 http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/pip
pip使用
后面加上-i参数,指定pip源
1 | pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple |
Pip更新
1 | python -m pip install –upgrade pip |
依赖包
- beautifulsoup4
- requests
- pymongo
- lxml