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

Python json 格式化 结果为 null

  •  
  •   Oane · Mar 4, 2019 · 4658 views
    This topic created in 2766 days ago, the information mentioned may be changed or developed.

    爬虫数据存储,json 格式化,最后检查时会有 null 的情况 似乎还是随机的 第一次跑和第二次跑 null 的情况不同 各位有遇到过类似情况吗?

    9 replies  •  2019-03-04 16:37:00 +08:00
    awanabe
        1
    awanabe  
       Mar 4, 2019
    格式化是什么? dumps?
    json.dumps(None)
    > 'null'
    Oane
        2
    Oane  
    OP
       Mar 4, 2019
    dump 数据都 print 出来了 但是最后的结果是 null
    summerwar
        3
    summerwar  
       Mar 4, 2019   ❤️ 2
    这种情况麻烦直接贴代码 靠猜是解决不了问题的
    Marsss
        4
    Marsss  
       Mar 4, 2019
    放码过来
    asLw0P981N0M0TCC
        5
    asLw0P981N0M0TCC  
       Mar 4, 2019
    @Oane 数据不标准 可能数据哪有问题
    shintendo
        6
    shintendo  
       Mar 4, 2019
    提问的艺术……
    MilkShake
        7
    MilkShake  
       Mar 4, 2019
    应该是数据没有标准,可以加个判断。
    cnoder
        9
    cnoder  
       Mar 4, 2019
    抓 json 异常
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1053 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 18:15 · PVG 02:15 · LAX 11:15 · JFK 14:15
    ♥ Do have faith in what you're doing.