Python爬虫

来源:互联网 发布:装修设计软件手机版 编辑:程序博客网 时间:2024/05/16 01:46
  • 介绍

作为一个美剧迷来说,找资源下载是个大问题,那通过爬虫来搞吧。

  • 安装

apt-get install python-pip

pip install scrapy

apt-get install python-scrapy

  • 爬虫之HelloWorld
  1. 新建工程:scrapy startproject usa_movie
  2. 执行爬虫:scrapy crawl usa_movie_spider
  3. 保存结果:scrapy crawl usa_movie_spider -o items.json -t json

注意:items.py是定义要爬的内容;

  • 参考

http://www.cnblogs.com/txw1958/archive/2012/07/16/scrapy-tutorial.html

查看原文:http://surenpi.com/2015/04/23/python%e7%88%ac%e8%99%ab/

0 0
原创粉丝点击