使用以前的建立虚拟环境方法(pipenv)shell
建立虚拟环境并进入虚拟环境json
mkdir douban
cd douban pipenv install pipenv shell
再安装咱们的scrapyscrapy
pipenv install scrapy
而后建立项目ide
scrapy startproject doubanmovie
cd doubanmovie
scrapy genspider douban_movie (这里加入你想要爬的网站url)
再使用pychram打开这个目录网站
写好代码后在pycharm下方点击终端输入url
scrapy crawl douban_movie
scrapy crawl douban_movie -o detail.json #为json格式保存
scrapy crawl douban_movie -o detail.jl #以行的形式保存
scrapy crawl douban_movie -o detail.csv #以csv文件格式保存
scrapy crawl douban_movie -o detail.xml #以xml文件格式保存
运行任务spa
简单使用结束code