TypeError: 'MongoClient' object is not callable——一个小错误,数据库的名字没用中括号
今天在用Python爬虫存储到MongoDB数据库的时候,老是报这个错误:TypeError: 'MongoClient' object is not callable
仔细检查后,发现是我在声明数据库的时候,将中括号[ ]换成了圆括号()
错误:
修改完成后的代码:
client = pymongo.MongoClient('localhost')
db = client['
原创
2017-04-20 17:21:11 ·
4882 阅读 ·
0 评论