【问题标题】:is there any other way to solve automation of whatsapp message?还有其他方法可以解决whatsapp消息的自动化吗?
【发布时间】:2021-05-29 04:33:30
【问题描述】:
我已使用基本解释器“conda”(即 miniconda 3)在 VS 代码中键入此代码
导入 pywhatkit
pywhatkit.sendwhatmsg("xxxxxxxx", "python 早上好",10,00)
x 是电话号码
问题是,它所做的只是将消息加载到 WhatsApp 的文本框中,它没有发送。我的程序有问题还是需要安装其他东西?
【问题讨论】:
标签:
python
visual-studio-code
automation
anaconda
whatsapp
【解决方案1】:
我有同样的问题,我发现需要在执行的代码和whatsapp web完全打开的时间之间设置足够的时间间隔来粘贴消息并发送它,尝试至少30秒或更多(wait_time = 30 或更多)。否则“在子弹进入现场之前拉动扳机”
【解决方案2】:
不允许在十进制整数文字中使用 00 作为前导零。对八进制整数使用 0o 前缀或以 0 以外的数字开始您的时间
【解决方案3】:
我正在使用此代码发送消息,它将在从当前时间开始的一分钟内发送消息,它将等待 20 秒并发送消息
import threading
import pywhatkit
import datetime
now = datetime.datetime.now()
hur = now.hour
min = now.minute
print(hur)
print(min+1)
pywhatkit.sendwhatmsg('+number', 'SENDING MESSAGE', now.hour,min+1)
【解决方案4】:
import pyautogui #importing the gui for mouse
import time
import pywhatkit #python WhatsApp package
# time.sleep(12) #to wait for sometime after the webwhatapp is opened and able to get the positon of trigger button
# print(pyautogui.position())
# Here I had found the position of trigger button of web whats app
pywhatkit.sendwhatmsg("+91 70029XXXX","hello bro",0,42)
#You are advice to to change the time and number so to message your desired number
time.sleep(5)
pyautogui.click(1240,640) #this click the trigger button so our message which was in textbox able to send the message