微信的一個庫 可以拿到微信的所有好友信息郎汪,利用UserName的信息給指定的用戶發(fā)信息,在利用時間模塊可以在指定的間隔時間給用戶發(fā)送信息,運(yùn)行的時候需要用微信掃碼下二維碼登錄
import itchat
# 登錄微信
itchat.auto_login(hotReload=True)
# 獲取好友信息
friends = itchat.get_friends()
print(list)
for items in friends:
firend = dict(items)
print(firend)
# 群發(fā)
# itchat.send('哈嘍,我在用python給你發(fā)信息呢',firend[UserName])
import time
while True:
# time.sleep(1)
# itchat.send('哈嘍,我在用python給你發(fā)信息呢~要不要試一下轟炸呼死你',friends[1]['UserName'])
print(friends['UserName'])
# itchat.send('哈哈哈哈成功!', "@c1902561fdea246959d52f8d128553b625675c857d69da2242229fa611399f0e")
itchat.send('轟炸信息來啦饿悬!', "")