【发布时间】: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
【问题讨论】: