推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
saximi
V2EX  ›  Python

关于用 Scrapy 框架开发爬虫时保存图片操作的咨询

  •  
  •   saximi · Oct 19, 2017 · 3147 views
    This topic created in 3330 days ago, the information mentioned may be changed or developed.
    用 Scrapy 框架开发爬虫,按照一般的规范,对图片进行下载并保存的操作是不是应当放在 pipelines.py 中实现呢?
    谢谢
    7 replies  •  2017-10-25 06:34:42 +08:00
    misaka19000
    misaka19000
    Oct 19, 2017
    1
    是的
    saximi
    saximi
    OP
    Oct 19, 2017
    2
    @misaka19000 谢谢!
    saximi
    saximi
    OP
    Oct 20, 2017
    4
    @misaka19000 爬虫下载图片的做法,是不是最好用的还是 urllib 模块和以下的步骤?
    req=urllib.request.Request(imageURL)
    response=urllib.request.urlopen(req)
    data=response.read()
    saximi
    saximi
    OP
    Oct 20, 2017
    5
    @sunwei0325 谢谢,我去学习学习
    saximi
    saximi
    OP
    Oct 24, 2017
    6
    @sunwei0325 请教,这个例子中的 get_media_requests(self,item,info)方法,info 参数是怎么个用法呢?谢谢
    sunwei0325
    sunwei0325
    Oct 25, 2017
    7
    @saximi 没什么用, 兼容旧版本的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1059 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:00 · PVG 07:00 · LAX 15:00 · JFK 18:00
    ♥ Do have faith in what you're doing.