python爬取微信

import itchat
itchat.logout()
itchat.login()
friends=itchat.get_friends(update=True)[0:]
result =  ('Signature', '个性签名')
for user in friends:
    with open('myFriends.csv', 'a', encoding='utf8') as f:
        if user.get(result[0]):
            f.write(result[1] + ":" + str(user.get(result[0])) + "\n")
print("完成")

#我这里只爬取了朋友的个性签名

爬取其它的,可以参考https://itchat.readthedocs.io/zh/latest/tutorial/tutorial0/

猜你喜欢

转载自blog.csdn.net/weixin_42557907/article/details/81546032