scrapy
scrapy安装及使用
一、scrapy安装过程
- Windows: 下载:http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted pip3 install wheel pip install Twisted‑18.4.0‑cp36‑cp36m‑win_amd64.whl pip3 install pywin32 pip3 install scrapy - Linux及Mac: pip3 install scrapy
二、Django及scrapy的创建使用过程
Django: # 创建project django-admin startproject mysite #进入创建的目录 cd mysite # 创建app python manage.py startapp app01 python manage.py startapp app02 # 启动项目 python manage.runserver Scrapy: # 创建project scrapy startproject xdb #进入创建的目录 cd xdb # 创建爬虫 scrapy genspider chouti chouti.com scrapy genspider cnblogs cnblogs.com # 启动爬虫 scrapy crawl chouti scrapy crawl chouti --nolog