""" author:张鑫 date:2021/11/3 15:15 """ # 导入模块 import pandas as pd import pymongo # 连接数据库 client = pymongo.MongoClient('localhost', 27017) db = client['zhaopin'] zhilian = db['zhilian'] # 读取数据 data = list(zhilian.find()) # 写入到Excel表 s = pd.DataFrame(data) # 命名表格 s.to_excel('./北京python爬虫工程师招聘信息_智联招聘.xlsx', encoding='utf8') print('导入成功')