推荐学习书目
› 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
larkifly
V2EX  ›  Python

用 python 写爬虫,如何获取网站的 logo 或者缩略图了

  •  
  •   larkifly · Aug 12, 2014 · 4735 views
    This topic created in 4432 days ago, the information mentioned may be changed or developed.
    如题,大家有什么好办法了。
    6 replies  •  2014-08-19 18:49:40 +08:00
    Zuckonit
        1
    Zuckonit  
       Aug 12, 2014
    缩略图,
    <link rel="shortcut icon" href="/static/img/icon_rayps_64.png" type="image/png" />
    <link rel="apple-touch-icon" href="/static/apple-touch-icon.png" />
    类似
    Zuckonit
        3
    Zuckonit  
       Aug 12, 2014
    ChiChou
        4
    ChiChou  
       Aug 12, 2014
    缩略图需要开 phantomjs 之类的软件渲染,成本(流量,系统硬件资源等)比较高。
    beordle
        5
    beordle  
       Aug 12, 2014
    Google Favicon API
    http://www.google.com/s2/favicons?domain=twitter.com
    而缩略图非常不好办了
    只能用Phantomjs这种 Headless 的浏览器截图.我见过的 API 都不完美.首先PNG不全.另外比如说国外的API抓不了国内.国内的抓不了国外.最好的办法就是自己抓 异步入库.
    hayao650
        6
    hayao650  
       Aug 19, 2014
    urllib.urlretrieve()应该可以
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2252 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 00:38 · PVG 08:38 · LAX 17:38 · JFK 20:38
    ♥ Do have faith in what you're doing.