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