使用python3获取微信好友并导入到excle中
import itchat
import xlwt
from time import time
itchat.auto_login(hotReload=True)
wbk = xlwt.Workbook()
sheet = wbk.add_sheet('sheet 1')
sheet.write(0, 0, '昵称')
sheet.write(0, 1, '备注')
sheet.write(0, 2, '性别')
sheet.write(0, 3, '签名')
sheet.write(0, 4, '城市')
friends = itchat.get_friends()[1:]
for index, friend in enumerate(friends):
sheet.write(index + 1, 0, friend['NickName'])
sheet.write(index + 1, 1, friend['RemarkName'])
if friend['Sex'] == '1':
sheet.write(index + 1, 2, '男')
if friend['Sex'] == '2':
sheet.write(index + 1, 2, '女')
else:
sheet.write(index + 1, 2, '未设置')
sheet.write(index + 1, 3, friend['Signature'])
sheet.write(index + 1, 4, friend['City'])
wbk.save(str(int(time())) + '.xls')
print('文件已经保存')
itchat.run()
- Python实践-itchat获取微信好友总人数以及男女比例
- Python和微信之获取好友昵称并制作wordcloud
- 使用Python微信库itchat获得好友和群组已撤回的消息
- 使用Python统计微信好友的男女比例
- 使用python抓取微信好友个性签名并形成词云(itchat;wordcloud)
- python项目:获取微信好友信息(一)抓取微信好友数据
- 使用Python对微信好友进行数据分析
- python项目:获取微信好友信息(二)csv数据读取与处理
- Python之获取微信好友信息
- python 获取微信好友列表(微信web)
- [置顶] Python 使用itchat 对微信好友数据进行简单分析
- python数据分析(1)——获取微信好友的统计信息
- Python如何使用urllib2获取网络资源
- python语言获取linux磁盘使用情况
- 使用Python获取Wikipedia 的url时出现“ERR_ACCESS_DENIED”怎么办?
- 如何使用python自动登录路由器且获取页面内容
- 使用python获取本地时区的几种方法
- Python - 获取校内(人人网)的所有好友照片存储到本地
- 使用Python模拟登录QQ邮箱获取QQ好友列表
- python使用管道获取其它进程的输出内容