温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

手机群发短信脚本python

发布时间:2020-07-08 09:56:50 来源:网络 阅读:2350 作者:编号014 栏目:编程语言

首先电脑上安装好adb工具包,然后手机usb接上电脑,需要打开调试模式
然后准备好一个表格,表格里准备好需要群发的手机号码

import os 
import pandas as pd 
import numpy as np 
import time
#群发短信,50个号码一发,读取表格中手机号,列名写“手机号”

content="短信内容"
mobiles=""
df = pd.read_excel('mobiles.xlsx')
#遍历表格,读取手机号
for index,row in df.iterrows():
    if index==len(df)-1:
        mobiles=mobiles+str(row['手机号'])
        os.popen("adb shell am start -a android.intent.action.SENDTO -d sms:{} --es sms_body {}".format(mobiles,content))
        time.sleep(2)
        #模拟发送
        os.popen("adb shell input keyevent 22")
        time.sleep(1)
        os.popen("adb shell input keyevent 66")
        time.sleep(120)
        os.popen("adb shell input keyevent 3")
    elif index % 50==0 and index!=0:

        mobiles=mobiles+str(row['手机号'])
        #打开短信,编辑短信
        os.popen("adb shell am start -a android.intent.action.SENDTO -d sms:{} --es sms_body {}".format(mobiles,content))
        time.sleep(2)
        #模拟发送
        os.popen("adb shell input keyevent 22")
        time.sleep(1)
        os.popen("adb shell input keyevent 66")
        time.sleep(120)
        os.popen("adb shell input keyevent 3")
        mobiles=""
    else:
        mobiles=mobiles+str(row['手机号'])+','
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI