jestin
 1 import itchat
 2 import pandas as pd
 3 
 4 inchat.auto_login(hotReload=True)
 5 friends=itchat.get_friends(update=True)[0:]
 6 
 7 list=[]
 8 for x in friends[0:]:
    #此处仅加了三个字段,实际远不止这些
9 list.append([x['RemarkName'],x['NickName'],x['Province']]) 10 11 datatable=pd.DataFrame(list) 12 datatable.to_excel("text.xlsx)

抓取微信联系人的脚本

1. 使用微信itchat包

2. 查看包里面姓名,昵称对应的索引值

3. 使用pd.DataFrame()写到excel【在此处花了好久,不知道DataFrame()怎么使用,得到的写入格式都不是自己想要的,最后发现就是一个二维数组格式】

分类:

技术点:

相关文章:

  • 2021-07-28
  • 2021-12-05
  • 2021-09-10
  • 2021-09-30
  • 2021-08-31
  • 2022-01-27
  • 2021-11-19
猜你喜欢
  • 2021-08-29
  • 2021-11-29
  • 2021-12-03
  • 2021-08-14
  • 2021-12-01
  • 2021-07-14
  • 2021-06-21
相关资源
相似解决方案