推荐学习书目
› 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 · 4770 views
    This topic created in 2817 days ago, the information mentioned may be changed or developed.

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

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