V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
plantparknet
V2EX  ›  Python

有谁试过用 python 获取 instagram 某个账号的所有图片么

  •  
  •   plantparknet · 2015-07-19 11:52:21 +08:00 · 5088 次点击
    这是一个创建于 3212 天前的主题,其中的信息可能已经有所发展或是发生改变。
    如题,发现图片全部是javascript加载
    第 1 条附言  ·  2015-07-19 12:48:39 +08:00
    系统是centos 64
    14 条回复    2015-07-21 08:24:01 +08:00
    paulw54jrn
        1
    paulw54jrn  
       2015-07-19 12:25:34 +08:00
    selenium / ghost.py
    frittle
        2
    frittle  
       2015-07-19 12:39:35 +08:00
    plantparknet
        3
    plantparknet  
    OP
       2015-07-19 12:48:04 +08:00
    @paulw54jrn 试过selenium,但是centos精简系统,各种报错。
    plantparknet
        4
    plantparknet  
    OP
       2015-07-19 12:48:19 +08:00
    @frittle File "app.py", line 34
    bytes = requests.get(url).content
    ^
    IndentationError: unexpected indent

    报错了。。。
    plantparknet
        5
    plantparknet  
    OP
       2015-07-19 13:49:34 +08:00
    @frittle 赞!搞定!不过运行过程中总是报这种错误,何解呢~~

    /usr/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
    InsecurePlatformWarning
    felinx
        6
    felinx  
       2015-07-19 14:08:20 +08:00
    我刚写过一个20行的代码抓,哈哈
    plantparknet
        7
    plantparknet  
    OP
       2015-07-19 14:55:38 +08:00
    @felinx 分享出来~~
    gaotongfei
        8
    gaotongfei  
       2015-07-19 15:14:07 +08:00 via iPad
    felinx
        9
    felinx  
       2015-07-19 18:34:07 +08:00
    @plantparknet 跟上面的类似,我是直接通过客户端的API抓的
    plantparknet
        10
    plantparknet  
    OP
       2015-07-19 20:39:30 +08:00
    @felinx 上面的好像木有一个是通过客户端API抓取的~~
    felinx
        11
    felinx  
       2015-07-19 22:07:10 +08:00
    @plantparknet 好吧,放出来 https://gist.github.com/felinx/8ece2c795eee508a90f9

    最后抓图我是简单的用wget,有需要可以改成用python抓。
    icedx
        12
    icedx  
       2015-07-20 00:06:46 +08:00
    frittle
        14
    frittle  
       2015-07-21 08:24:01 +08:00
    @plantparknet 不知道。或许这是「不正当」提取,不过Intagram也没禁用……

    p.s. 那个是username,Instagram的user id 是数字
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2336 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 06:33 · PVG 14:33 · LAX 23:33 · JFK 02:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.