【问题标题】:MongoDB Unexpected end of JSON input, using python to scrapeMongoDB JSON输入意外结束,使用python进行抓取
【发布时间】:2018-10-15 22:34:07
【问题描述】:

所以我在 fanfiction.net 上抓取故事数据,然后返回一本字典。我将字典转储到我的 json 文件中,并确保它有效,然后当我尝试将 JSON 文件导入 MongoDB 时,它作为 JSON 输入的意外结束返回。我用谷歌搜索,似乎没有人对此有答案。我将附加一个指向我尝试导入的整个数据文件的链接,并且有多个类似的文件需要导入。还附上了我必须导入的原始 JSON:

{
    "id": "4391921",
    "canon": "Supernatural",
    "author_id": 3240,
    "title": "Light of Day, Dark of Moon",
    "lang": "English",
    "published": 1215966904,
    "chapter_names": [
        "Light of Day, Dark of Moon"
    ],
    "genres": [
        "Drama",
        "Family"
    ],
    "canon_type": [
        "TV Shows"
    ],
    "rated": "Fiction  T",
    "num_words": 3441,
    "num_reviews": 38,
    "num_favs": 79,
    "num_follows": 11,
    "status": "Complete"
},
{
    "id": "4391909",
    "canon": "Supernatural",
    "author_id": 3240,
    "title": "A Year and a Day",
    "lang": "English",
    "published": 1215966494,
    "chapter_names": [
        "A Year and a Day"
    ],
    "genres": [
        "Drama",
        "Hurt/Comfort"
    ],
    "canon_type": [
        "TV Shows"
    ],
    "rated": "Fiction  M",
    "num_words": 32830,
    "num_reviews": 10,
    "num_favs": 46,
    "num_follows": 3,
    "status": "Complete"
},

https://github.com/ethanbreck/fanfiction-api-scraper/tree/master/data/user_write

【问题讨论】:

    标签: python json mongodb


    【解决方案1】:

    使用 Compass 导入同样的错误。请改用 Studio 3T!!这对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-10
      • 2021-09-05
      • 2015-08-05
      • 2015-03-15
      • 2018-05-15
      • 2021-10-03
      • 1970-01-01
      相关资源
      最近更新 更多